News for hackers. Stuff that matters.
Re:Fluent 1.0: a localization system for natural-sounding tr... by drdaeman on Wednesday April 17, 2019 @01:49PM (#19684788)
> `[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.

Re:Fluent 1.0: a localization system for natural-sounding tr... by zbraniecki on Wednesday April 17, 2019 @03:38PM (#19685756)
That'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

Re:Fluent 1.0: a localization system for natural-sounding tr... by stasm on Thursday April 18, 2019 @04:12AM (#19689533)
It'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=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.

Re:Fluent 1.0: a localization system for natural-sounding tr... by schoen on Wednesday April 17, 2019 @03:13PM (#19685522)