Document the `use-explicit-plural-values` gen-l10n option
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
从 sites/docs/src/content/ui/internationalization/index.md 开始,重点查看“Configuring the l10n.yaml file”表格和“Placeholders, plurals, and selects”部分。说明该选项如何改变对 =N 的精确匹配,并补充其默认值以及 CLI/配置名称;阐明显式值与 locale 复数类别的区别。完成标准是两个部分都准确描述该选项,且示例与链接的 Flutter 更改保持一致。
由索引模型根据 Issue 内容生成。
描述
Related code pull request or issue
https://github.com/flutter/flutter/pull/194816
Feature summary
flutter/flutter#194816 adds an opt-in use-explicit-plural-values option to flutter gen-l10n (l10n.yaml and --use-explicit-plural-values).
Today, gen-l10n maps the explicit plural values =0, =1 and =2 to the plural categories zero, one and two. In many locales those categories cover more than the exact number, so =1{1 item} is also shown for 21, 31 and 101 in Ukrainian, and for 0 in French. With the option enabled, explicit values match only that exact number and take precedence over the categories, as specified by ICU. Any non-negative integer can be used (=3, =10), and =1 and one can be used in the same message. The option defaults to false.
Type of documentation needed
- New conceptual page or guide
- Update to an existing guide on docs.flutter.dev
- Cookbook recipe or practical code sample
- CLI or tooling documentation
- Platform support or integration guide
- Breaking change migration guide
Code snippet or usage example
// l10n.yaml
// use-explicit-plural-values: true
//
// app_uk.arb
// "items": "{count, plural, =0{Немає елементів} =1{Рівно один елемент} one{{count} елемент} few{{count} елементи} many{{count} елементів} other{{count} елемента}}"
//
// Generated code:
String _temp0 = count == 0
? 'Немає елементів'
: count == 1
? 'Рівно один елемент'
: intl.Intl.pluralLogic(
count,
locale: localeName,
other: '$count елемента',
one: '$count елемент',
few: '$count елементи',
many: '$count елементів',
);
Additional context or resources
Pages to update in sites/docs/src/content/ui/internationalization/index.md:
- The "Configuring the l10n.yaml file" table: add a
[no-]use-explicit-plural-valuesrow, for example: "Whether explicit plural cases such as=1match only that exact value and take precedence over plural categories such asone, as specified by ICU. When false (the default),=0,=1and=2are treated aszero,oneandtwo." - The "Placeholders, plurals, and selects" section currently presents
=0,=1and=2alongsidefewandmanyas if they were the same kind of case. It would help to explain the difference between explicit values (=N, exact match) and plural categories (zero,one,two,few,many,other, chosen by the locale's plural rules), and mention the new option.
Volunteer to help write this documentation
- Draft the documentation PR on docs.flutter.dev.
- 主要语言
- Dart
- 星标
- 3.1k
- 派生
- 3.5k
- 平均合并
- 2 天 2 小时
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
flutter/website 的其他 Issue
-
a.tut.codelab-google fix.code-sample fix.link fix.typo from.flutter-sdk p2-medium
难度 1/5 1 小时以内 新手友好度 65/100
flutter/website#13967 · 3 条评论 ·
维护者通常 1 天内回复
-
Need dev info for running on iOS可能已有人在做 @poyito777 于 20 天前认领。 未关闭from.page-issue p2-medium
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Missing download link on install page可能已有人在做 @conooi 于 19 天前认领。 未关闭from.page-issue p1-high
难度 2/5 1-3 小时 新手友好度 72/100
flutter/website#13540 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
At step 5th in `Get to know Firebase for Flutter` codelabs, the screenshot is not synced with code未关闭a.tut.codelab-google p2-medium
难度 2/5 1-3 小时 新手友好度 76/100
flutter/website#13816 · 5 条评论 ·
维护者通常 1 天内回复
-
[ui/accessibility] Update web-accessibility.md for Flutter 3.50 WCAG 2.1 AA improvements and fix duplicated sentence可能已有人在做 @kevmoo 于 3 天前认领。 未关闭a.rn.release-notes d.enhancement e1-hours fix.typo from.team p2-medium t.a11y target.web
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Not all highlighting kinds have examples in DartColorsAndFontsPage可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good-first-issue P3
难度 2/5 1-3 小时 新手友好度 88/100
flutter/dart-intellij-third-party#758 ·
维护者通常 1 天内回复
-
Bug: Incorrect location coordinates on logged Sound Meter data可能已有人在做 @Jashan32 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
area/archive bug
难度 2/5 1-3 小时 新手友好度 76/100
DarkFlippers/qUnleashed#374 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
Predidit/Kazumi#2734 · 1 条评论 ·
维护者通常 1 天内回复