Repository navigation
Open
Labels
act.await-dev-prNeeds dev PR to merge before merging docsNeeds dev PR to merge before merging docsd.enhancementImproves docs with specific askImproves docs with specific aske0-minutesEffort: < 60 minEffort: < 60 minp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.t.cli-toolsRelates to flutter <tool> toolsRelates to flutter <tool> toolst.i18nRelates to internationalization of Flutter appsRelates to internationalization of Flutter appst.l10nRelates to localizing Flutter text in appsRelates to localizing Flutter text in apps
Description
Related code pull request or issue
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.
Metadata
Metadata
Assignees
Labels
act.await-dev-prNeeds dev PR to merge before merging docsNeeds dev PR to merge before merging docsd.enhancementImproves docs with specific askImproves docs with specific aske0-minutesEffort: < 60 minEffort: < 60 minp2-mediumNecessary but not urgent concern. Resolve when possible.Necessary but not urgent concern. Resolve when possible.t.cli-toolsRelates to flutter <tool> toolsRelates to flutter <tool> toolst.i18nRelates to internationalization of Flutter appsRelates to internationalization of Flutter appst.l10nRelates to localizing Flutter text in appsRelates to localizing Flutter text in apps
Activity
busradansmn commentedon Nov 5, 2026
Hi! I’d like to work on this documentation. I’ll update the l10n.yaml table and the plurals section in internationalization/index.md. I understand the code PR (flutter/flutter#194816) needs to merge first, so I’ll open my PR as a draft until then.
[gen_l10n] Add `use-explicit-plural-values` option (flutter#194816)
mitryp commentedon Nov 11, 2026
@busradansmn thanks! Just to let you know, my PR has just been merged to master