Skip to content

docs: zh-cn page object models - #2744

Open
alaahong wants to merge 4 commits into
SeleniumHQ:trunkfrom
alaahong:translate/zh-cn-page-object-models
Open

docs: zh-cn page object models#2744
alaahong wants to merge 4 commits into
SeleniumHQ:trunkfrom
alaahong:translate/zh-cn-page-object-models

Conversation

@alaahong

Copy link
Copy Markdown
Member

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

Update website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md

Motivation and Context

Update PO page as Chinese version

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

alaahong added 3 commits July 26, 2026 09:41
Translate the entire page_object_models.zh-cn.md from English to Chinese.
The file was previously marked with needsTranslation: true and contained
mostly untranslated English prose.

Translation details:
- Translate all prose content (overview, advantages, examples, assertions,
  page component objects, implementation notes, summary, etc.)
- Preserve all code blocks unchanged, including code comments
- Remove needsTranslation: true flag
- Update title/linkTitle from 'PO设计模式' to '页面对象模型'
- Terminology follows ISTQB standard and MDN conventions:
  * Page Object Model -> 页面对象模型
  * Design Pattern -> 设计模式
  * Test automation -> 测试自动化
  * Assertion -> 断言
  * Verification -> 验证
  * AUT -> 被测应用 (AUT)
  * Locator -> 定位器
  * Page Component Object -> 页面组件对象
  * Composition -> 组合
  * Strategy Pattern -> 策略模式
  * Fluent syntax -> 流畅语法
  * Maintainability -> 可维护性
Updated the Chinese translation of the page_object_models documentation
to enhance readability and consistency. Adjusted spacing and punctuation
for better clarity.

- Fixed spacing issues around UI mapping terminology
- Improved sentence structure for better flow
Updated the Chinese translation of the page_object_models documentation
to enhance readability and consistency. Adjusted spacing and punctuation
for better clarity.

- Fixed spacing issues around UI mapping terminology
- Improved sentence structure for better flow
@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

👷 Deploy request for selenium-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2961305

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Update zh-cn Page Object Models documentation translation

📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Translate the Page Object Models (POM) page into Simplified Chinese.
• Remove the needsTranslation flag and update the document’s Chinese title.
• Improve formatting, terminology consistency, and readability while preserving code blocks.
Diagram

graph TD
  C(("Contributor")) --> M["zh-cn Markdown"] --> H(["Hugo build"]) --> S{{"selenium.dev (zh-cn)"}} --> R(("Readers"))

  subgraph Legend
    direction LR
    _act(("Actor")) ~~~ _file["Content source"] ~~~ _svc(["Build step"]) ~~~ _ext{{"Published site"}}
  end
Loading
High-Level Assessment

The PR’s approach—fully translating prose while keeping code blocks unchanged and removing the needsTranslation marker—is the right, low-risk way to complete a pending translation. Alternatives like machine translation + post-editing or partial translation would add inconsistency and reviewer burden without clear benefit here.

Files changed (1) +127 / -107

Documentation (1) +127 / -107
page_object_models.zh-cn.mdComplete zh-cn translation of Page Object Models page +127/-107

Complete zh-cn translation of Page Object Models page

• Replaces previously untranslated English prose with a full Simplified Chinese translation across all sections. Updates frontmatter title/linkTitle to match the topic name and removes the 'needsTranslation: true' flag. Improves formatting/clarity while keeping code samples intact.

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md

@qodo-code-review

qodo-code-review Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 10 rules

Grey Divider


Remediation recommended

1. Binding-specific (this) in prose ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The updated Chinese documentation includes the binding-specific keyword this in explanatory prose,
which makes the guidance less language-agnostic. This conflicts with the requirement to keep
normative documentation prose free of binding-specific terminology.
Code

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[R382-383]

+为此,**页面对象上的方法可以返回另一个页面对象、另一个页面组件对象,
+甚至自身 (this)**。这意味着我们可以有效地对用户在应用程序中的旅程进行建模。
Evidence
PR Compliance ID 2141345 requires documentation prose to remain language-agnostic and avoid
binding-specific terminology. The added text explicitly includes the keyword this in general
explanatory prose at the cited lines.

Rule 2141345: Keep documentation prose language-agnostic, avoiding binding-specific terminology
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[382-383]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The documentation prose includes the language keyword `this` (`甚至自身 (this)`), which is binding-specific and reduces language-agnostic guidance.

## Issue Context
This page is part of Selenium documentation and should avoid binding-specific terminology in general/prose descriptions.

## Fix Focus Areas
- website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[382-383]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Underscore emphasis broken ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The text "页面_组件_对象" uses intraword underscores, which commonly render as literal underscores (not
italics) in Hugo/CommonMark-style Markdown, so the intended emphasis is lost in the published page.
This is inconsistent with the English source formatting and with other emphasis usage on the same
page.
Code

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[204]

+创建"页面_组件_对象"(后来的称呼),它表示页面的离散区块,
Evidence
The zh-cn translation introduces intraword underscores (页面_组件_对象), while the English source uses
spaced underscores for emphasis, and the zh-cn page elsewhere uses spaced underscores, indicating
the intended Markdown style.

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[203-206]
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[247-249]
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md[206-210]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The translation uses `页面_组件_对象`, where the underscores are adjacent to CJK characters; many Markdown parsers won’t treat those underscores as emphasis delimiters, so the output may show literal underscores.

### Issue Context
The English source uses spaced underscore emphasis (`Page _Component_ Objects`), and this same zh-cn page already uses spaced underscores for emphasis elsewhere (e.g., `某个事物 _由_ ... _组成_`).

### Fix Focus Areas
- website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[203-206]

### Suggested fix
Change `创建"页面_组件_对象"...` to a form that reliably renders emphasis, e.g.:
- `创建"页面 _组件_ 对象"...` (adds spaces around the emphasis), **or**
- `创建"页面 **组件** 对象"...` (use bold to avoid inserting spaces in Chinese text).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 2961305 ⚖️ Balanced

Results up to commit c031157 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Binding-specific (this) in prose ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
The updated Chinese documentation includes the binding-specific keyword this in explanatory prose,
which makes the guidance less language-agnostic. This conflicts with the requirement to keep
normative documentation prose free of binding-specific terminology.
Code

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[R382-383]

+为此,**页面对象上的方法可以返回另一个页面对象、另一个页面组件对象,
+甚至自身 (this)**。这意味着我们可以有效地对用户在应用程序中的旅程进行建模。
Evidence
PR Compliance ID 2141345 requires documentation prose to remain language-agnostic and avoid
binding-specific terminology. The added text explicitly includes the keyword this in general
explanatory prose at the cited lines.

Rule 2141345: Keep documentation prose language-agnostic, avoiding binding-specific terminology
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[382-383]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The documentation prose includes the language keyword `this` (`甚至自身 (this)`), which is binding-specific and reduces language-agnostic guidance.

## Issue Context
This page is part of Selenium documentation and should avoid binding-specific terminology in general/prose descriptions.

## Fix Focus Areas
- website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[382-383]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
2. Underscore emphasis broken ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The text "页面_组件_对象" uses intraword underscores, which commonly render as literal underscores (not
italics) in Hugo/CommonMark-style Markdown, so the intended emphasis is lost in the published page.
This is inconsistent with the English source formatting and with other emphasis usage on the same
page.
Code

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[204]

+创建"页面_组件_对象"(后来的称呼),它表示页面的离散区块,
Evidence
The zh-cn translation introduces intraword underscores (页面_组件_对象), while the English source uses
spaced underscores for emphasis, and the zh-cn page elsewhere uses spaced underscores, indicating
the intended Markdown style.

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[203-206]
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[247-249]
website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md[206-210]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The translation uses `页面_组件_对象`, where the underscores are adjacent to CJK characters; many Markdown parsers won’t treat those underscores as emphasis delimiters, so the output may show literal underscores.

### Issue Context
The English source uses spaced underscore emphasis (`Page _Component_ Objects`), and this same zh-cn page already uses spaced underscores for emphasis elsewhere (e.g., `某个事物 _由_ ... _组成_`).

### Fix Focus Areas
- website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md[203-206]

### Suggested fix
Change `创建"页面_组件_对象"...` to a form that reliably renders emphasis, e.g.:
- `创建"页面 _组件_ 对象"...` (adds spaces around the emphasis), **or**
- `创建"页面 **组件** 对象"...` (use bold to avoid inserting spaces in Chinese text).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Simplified Chinese version of the “Page object models” documentation page to better match the English source and removes the “needsTranslation” flag now that the page content is translated.

Changes:

  • Renamed the page title/linkTitle to “页面对象模型” and removed needsTranslation: true from front matter.
  • Replaced the English prose with a full zh-cn translation while preserving headings, structure, and code fences.
Comments suppressed due to low confidence (1)

website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md:248

  • There is an extra space before the Chinese full stop at the end of the sentence, which will render as visible whitespace after the italic text. Remove the space so the punctuation directly follows the emphasized phrase.
简单来说,某个事物 _由_ 另一个事物 _组成_ 。

- Fix underscore emphasis: 页面_组件_对象 → 页面 _组件_ 对象
  (intraword underscores don't render as italics in CommonMark)
- Remove binding-specific 'this' from prose: 甚至自身 (this) → 甚至自身
  (style guide requires language-agnostic documentation prose)
- Remove extra space before Chinese full stop in two sentences

Fixes review comments from Copilot and Qodo on PR SeleniumHQ#2744.
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 2961305

@alaahong alaahong changed the title Translate/zh cn page object models docs: zh-cn page object models Jul 26, 2026
@rpallavisharma

Copy link
Copy Markdown
Member

hey @alaahong i don't know the language. the checks have all passed.
TLC members can further review this. please assign to selenium tlc members. thanks

@rpallavisharma rpallavisharma removed their assignment Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants