Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate English text of Finders.zh-cn.md page into Chinese #1592

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

geekmister
Copy link
Contributor

Translate English text of Finders.zh-cn.md page into Chinese

Description

I just modify Finders.zh-cn.md to translate English text into Chinese.

Motivation and Context

Help Chinese to reading the section. It solved the problem that part of chinese to read diffcaulty English.

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.

Copy link

netlify bot commented Feb 28, 2024

👷 Deploy request for selenium-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit bdf1b62

@geekmister
Copy link
Contributor Author

About the second option of CheckList, it's not done. Because of try and try build local enviroment with hugo is failed. But I just translate, then preview with markdown. So, I think no problems.

@diemol diemol requested a review from alaahong February 28, 2024 17:16
Copy link
Member

@alaahong alaahong left a comment

Choose a reason for hiding this comment

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

Thanks for your commit, can you kindly take a look on the comments?

Generally the NAME property should be unique for a element on the web page.
We will identify the Newsletter checkbox using it.

我们可以在一个网页中使用元素可用属性`NAME`来定位它。通常在网页中严肃`NAME`属性应该是唯一的。我们将使用`NAME`来识别`Newsletter`复选框。
Copy link
Member

Choose a reason for hiding this comment

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

What‘s the 严肃NAME ?

Generally the ID property should be unique for a element on the web page.
We will identify the Last Name field using it.

我们可以在一个网页中使用元素可用属性`ID`来定位它。通常在网页中元素的`ID`属性应该是唯一的。我们将使用`ID`来识别`Last Name`字段。
Copy link
Member

Choose a reason for hiding this comment

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

Seems no need to involve additional back quote, you can just leave the English keywords there and the back quote has special usage in markdown.

@@ -1,21 +1,17 @@
---
title: "查询网络元素"
linkTitle: "查询器"
title: "查找网页元素"
Copy link
Member

Choose a reason for hiding this comment

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

where is the web page ?

There are many ways to use the locators in very advanced scenarios. For the purposes of this documentation,
let's consider this HTML snippet:

获得元素的引用是使用`Selenium`最重要且最基本的应用。`Selenium`提供内置定位器策略用来唯一地标识一个元素。在非常复杂的场景中有很多种方式使用定位器。为了表达这篇文档的目的,让我们探讨下这段`HTML`片段。
Copy link
Member

Choose a reason for hiding this comment

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

Please read this if you want to contribute more , it's not recommended for such a long line

https://www.selenium.dev/documentation/about/contributing/#step-4-commit

returns a reference to the first element in the DOM that matches with the provided locator.
This value can be stored and used for future element actions. In our example HTML above, there are
two elements that have a class name of "tomatoes" so this method will return the element in the "vegetables" list.
当查找元素方法被驱动实例调用时,它会返回使用提供的定位器在文档中匹配到的第一个元素的引用。这个值可以存储和以后的元素操作中使用。在我们的`HTML`示例上,有两个元素的样式类名是`tomatoes`,所以这个方法会返回`vegetables`列表中的元素。
Copy link
Member

@alaahong alaahong Mar 3, 2024

Choose a reason for hiding this comment

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

What‘s your opinion on "这个值可以存储和以后的元素操作中使用。" ?

Rather than finding a unique locator in the entire DOM, it is often useful to narrow the search to the scope
of another located element. In the above example there are two elements with a class name of "tomatoes" and
it is a little more challenging to get the reference for the second one.
而不是在整个文档中查找一个唯一的定位器,在另一个已经定位元素范围内缩小查找范围是常常有用的。在示例上有两个元素使用了`tomatoes`的样式类名,获得第二个元素的引用就有些困难了。
Copy link
Member

Choose a reason for hiding this comment

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

In Chinese, we won't use “而不是” as the start of one paragraph, no any context there.

than just the first one. The plural find elements methods return a collection of element references.
If there are no matches, an empty list is returned. In this case,
references to all fruits and vegetable list items will be returned in a collection.
有几个用例需要获得匹配定位器的所有元素的引用,而不只是获得第一个匹配到元素。查找多个元素的方法会返回一个元素引用集合。如果没有匹配,这返回一个空的列表。在这个用例中,将返回所有`fruits`和`vegetable`的列表项元素引用的集合。
Copy link
Member

Choose a reason for hiding this comment

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

Sounds odd "而不只是获得第一个匹配到元素"


常常你想从获得的元素集合中获得指定的元素,意思是你需要遍历集合和识别出你想要的那个。
Copy link
Member

Choose a reason for hiding this comment

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

sounds odd...


It is used to find the list of matching child WebElements within the context of parent element.
To achieve this, the parent WebElement is chained with 'findElements' to access child elements
它用于在父元素上下文内查找匹配子元素的列表,实现这个,父元素使用`findElements`访问子元素。
Copy link
Member

Choose a reason for hiding this comment

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

you can try better on "To achieve this, the parent WebElement is chained with 'findElements' to access child elements"

---

定位器是在页面上标识元素的一种方法。它是传送给
[查找元素]({{< ref "finders.md" >}}) 方法的参数。
定位器是一种在页面上识别元素的方法。定位器是[查找元素]({{< ref "finders.md" >}}) 方法的参数。
Copy link
Member

Choose a reason for hiding this comment

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

why remove the line breaks ...

@alaahong
Copy link
Member

alaahong commented Mar 3, 2024

Hi, some tips.

  1. You should review the contribution guide https://www.selenium.dev/documentation/about/contributing/#step-4-commit
  2. No need to add additional punctuation, it will confuse other translators when they working later
  3. No need to change all as your styles even there are existing translated parts and no big gap in translated version
  4. Just read again and again before commit, some parts are hard to read and understand.

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.

None yet

2 participants