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

sync with english version for localeCompare() #10770

Merged
merged 1 commit into from
Dec 26, 2022

Conversation

yin1999
Copy link
Member

@yin1999 yin1999 commented Dec 25, 2022

Description

sync with english version for localeCompare()

@github-actions github-actions bot added the l10n-zh Issues related to Chinese content. label Dec 25, 2022
- **`locales`**
- : 可选。用来表示一种或多种语言或区域的一个符合 [BCP 47](https://tools.ietf.org/html/rfc5646) 标准的字符串或一个字符串数组。`locales` 参数的一般形式与解释,详情请参考 [Intl page](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation)。下列的 Unicode 扩展关键词是允许的:**`co`**为了某些地域多样的排序规则。可能的值包括: `"big5han"`, `"dict"`, `"direct"`, `"ducet"`, `"gb2312"`, `"phonebk"`, `"phonetic"`, `"pinyin"`, `"reformed"`, `"searchjl"`, `"stroke"`, `"trad"`, `"unihan"`。 `"standard"` 和`"search"` 这两个值是被忽略的; 它们被 `options` 的属性 `usage` 代替 (往下看)。**`kn`**指定数值排序是否应该被使用,像是这样 "1" < "2" < "10"。可能的值是 `"true"` 和 `"false"`。这个选项能被通过`options` 属性设置或通过 Unicode 扩展。假如两个都被设置了,则 `options` 优先。(*"*language*-*region\*-u-kn-true|false")**`kf`** 指定是否优先对大写字母或小写字母排序。可能的值有 `"upper"`, `"lower"`, 或 `"false"` (use the locale's default)。这个选项能被通过 `options` 属性设置或通过 Unicode 扩展。假如两个都被设置了,则 `options` 优先。*("*language*-*region*-u-kf-upper|lower|false")*
- `options`
在支持 [`Intl.Collator` API](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) 的实现中,这些参数与 [`Intl.Collator()`](/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator) 构造函数的参数完全对应。而对于不支持 `Intl.Collator` 的实现,则要求函数忽略这两个参数,使得函数使用的区域(locale)以及返回的字符串的格式完全取决于实现——仅要求其与比较结果保持*一致*。
Copy link
Member Author

Choose a reason for hiding this comment

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

仅要求其与比较结果保持一致

Consider more appropriate translation

https://tc39.es/ecma262/multipage/indexed-collections.html#consistent-comparator

@github-actions
Copy link
Contributor

Preview URLs

Flaws (5)

URL: /zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
Title: String.prototype.localeCompare()
Flaw count: 5

  • broken_links:
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback
    • Can use the English (en-US) link as a fallback

@yin1999 yin1999 marked this pull request as ready for review December 26, 2022 01:18
@yin1999 yin1999 requested a review from a team as a code owner December 26, 2022 01:18
@yin1999 yin1999 requested review from irvin and removed request for a team December 26, 2022 01:18
@yin1999 yin1999 merged commit 01d720a into mdn:main Dec 26, 2022
@yin1999 yin1999 deleted the sync-localeCompare branch December 26, 2022 06:11
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
None yet
Development

Successfully merging this pull request may close these issues.

1 participant