3 ms·
> `[one] 1 time *[other] {$clickCount} times` How does this work for languages that have more complex pluralization rules? E.g. in Russian it's "1 раз", "2 ра
by drdaeman 8y ago
> `[one] 1 time *[other] {$clickCount} times`
How does this work for languages that have more complex pluralization rules?
E.g. in Russian it's "1 раз", "2 раза", "11 раз", "12 раз", "22 раза" and "55 раз" - the case depends on the number ending, with exceptions for 11, 12, 13 and 14.
- schoen 8y agoArabic is even more complicated! https://en.wikipedia.org/wiki/Arabic_grammar#Cardinal_numerals https://en.wikipedia.org/wiki/Arabic_grammar#Cardinal_numera...
- zbraniecki 8y agoThat's a great question! Fluent relies on Unicode Plural Rules [0] which allow us to handle all (as far as Unicode knows) pluralization rules for cardinal and ordinal (and range) categories :) [0] http://cldr.unicode.org/index/cldr-spec/plural-rules http://cldr.unicode.org/index/cldr-spec/plural-rules
- stasm 8y agoIt's up to the localizer to define variants corresponding to the language's plural categories. For Russian, that's (one, few, many). Interestingly, this particular example could simplified to (few, *), because "раз" is good for both 1, 5, 11, 55, etc. See https://projectfluent.org/play/?id=7d22f87c04b23b86d9f9149d5d1090fc https://projectfluent.org/play/?id=7d22f87c04b23b86d9f9149d5... for an example of this in action. Authoring tools can help here, too. Pontoon, Mozilla's translation management system, pre-populates plural variants based on the number of plural categories defined in Unicode's CLDR.