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

zh-cn: sync the translation of "data structures" #24191

Merged
merged 22 commits into from
Nov 1, 2024

Conversation

familyboat
Copy link
Contributor

Description

英文版内容有更新,对中文本做同步。
关于强制类型转换章节部分的内容的说明:numeric和number的中文表达都是数字。我本想将其都用英文进行表达(这样更容易对这两个概念进行区分),但numeric出现在标题这个位置,改动后,会对其他文章中相应的引用造成影响。所以,我把number保留了英文,而numeric还是翻译为数字。string为了保持一致,也是保留为英文(我觉得翻译成字符串也可以)

Motivation

Additional details

Related issues and pull requests

@familyboat familyboat requested a review from a team as a code owner October 22, 2024 04:39
@familyboat familyboat requested review from t7yang and removed request for a team October 22, 2024 04:39
@github-actions github-actions bot added the l10n-zh Issues related to Chinese content. label Oct 22, 2024
Copy link
Contributor

github-actions bot commented Oct 22, 2024

Preview URLs

External URLs (2)

URL: /zh-CN/docs/Web/JavaScript/Data_structures
Title: JavaScript 数据类型和数据结构

(comment last updated: 2024-11-01 04:24:03)

familyboat and others added 2 commits October 22, 2024 12:44
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@yin1999 yin1999 left a comment

Choose a reason for hiding this comment

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

160 行之前的内容的审查

files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
files/zh-cn/web/javascript/data_structures/index.md Outdated Show resolved Hide resolved
Comment on lines 207 to 209
此外,数组对象继承了 `Array.prototype` 的一组操作数组的便捷方法。例如,[`indexOf()`](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)(搜索数组中的一个值)或 [`push()`](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/push)(向数组追加一个元素),等等。这使得数组成为表示有序列表的理想选择。

[类型化数组](/zh-CN/docs/Web/JavaScript/Guide/Typed_arrays)表示底层二进制缓冲区的类数组视图,并且提供了与数组相对应的类似语义的方法。“类型化数组”是一系列数据结构的总话术语,包括 `Int8Array`、`Float32Array` 等等。获取更多细节,请查看[类型化数组](/zh-CN/docs/Web/JavaScript/Guide/Typed_arrays)页。类型化数组通常与 {{jsxref("ArrayBuffer")}} 和 {{jsxref("DataView")}} 一起使用
[类型化数组](/zh-CN/docs/Web/JavaScript/Guide/Typed_arrays)表示底层二进制缓冲区的类数组视图,并且提供了对应的类似数组语义的方法。“类型化数组”是一系列数据结构的总话术语,包括 `Int8Array`、`Float32Array` 等等。获取更多细节,请查看[类型化数组](/zh-CN/docs/Web/JavaScript/Guide/Typed_arrays)页。类型化数组通常用于连接 {{jsxref("ArrayBuffer")}} 和 {{jsxref("DataView")}}。
Copy link
Member

Choose a reason for hiding this comment

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

这两段感觉都可以不进行修改(特别是第二段的最后一句,我觉得修改前的版本更好,“连接 a 和 b”,这里的连接是什么意思,参见 DataView 中的示例,可知它们三个是可以搭配着一起使用的,并不是“连接”关系)


### 带键的集合:Map、Set、WeakMap、WeakSet

这些数据结构把对象的引用当作键。{{jsxref("Set")}} 和 {{jsxref("WeakSet")}} 表示唯一值的集合,而 {{jsxref("Map")}} 和 {{jsxref("WeakMap")}} 表示键值相关联的集合。
这些数据结构用对象引用当作键。{{jsxref("Set")}} 和 {{jsxref("WeakSet")}} 表示唯一值的集合,而 {{jsxref("Map")}} 和 {{jsxref("WeakMap")}} 表示键值相关联的集合。
Copy link
Member

Choose a reason for hiding this comment

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

我更喜欢之前的翻译,可以多读几遍试试


### 其他类型强制转换

所有除了 null、undefined 以及 Symbol 的数据类型,都有它们各自的强制转换过程。更多细节,请参见[字符串强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String#字符串强制转换)、[布尔值强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion)以及[对象强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)。
除了 null、undefined 以及 Symbol 以外,所有的数据类型都有它们各自的强制转换过程。更多细节,请参见 [string 强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String#字符串强制转换)、[boolean 强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion)以及 [object 强制转换](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion)。
Copy link
Member

Choose a reason for hiding this comment

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

hash 更新,我可能更倾向于对这些类型进行翻译。之前不翻译数字类型的原因是:需要区分 numeric、number 和 BitInt。

/cc @mdn/yari-content-zh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我认为可以,number和bigint不翻译,其他的都翻译。我按照这个原则进行了调整。

@familyboat
Copy link
Contributor Author

对文章整体又过了一遍,修改了一些错误。应用了你的评论意见,boolean_coercion在对应的文章中还没有相关的译文,就没有改这个hash了。

@familyboat familyboat requested a review from yin1999 October 26, 2024 07:11
@familyboat
Copy link
Contributor Author

我现在还有一个疑问,这本文中的number不翻译比较好,翻译为“数字”就会和numeric产生混淆(所有出现number的地方),不知道你是什么想法。

@familyboat
Copy link
Contributor Author

或许number可以翻译为数字,感觉这种翻译是一种历史遗留的产物。而且将number翻译为数字的这种做法在整个简中版中很常见,想要全部做出改变需要投入很大的精力和时间。我认为这里可以保持现状。看看你对其他的地方还有没有什么意见和想法。 @yin1999

@yin1999
Copy link
Member

yin1999 commented Oct 30, 2024

boolean_coercion在对应的文章中还没有相关的译文,就没有改这个hash了。

还是请翻译一下,可以参照其他的几个标题翻译(这样可以避免后续额外的维护工作)

@familyboat
Copy link
Contributor Author

hash 已处理 @yin1999

@yin1999 yin1999 merged commit cd302aa into mdn:main Nov 1, 2024
7 checks passed
@familyboat familyboat deleted the update_data_structures branch November 1, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-zh Issues related to Chinese content.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants