Comment on Improving support for plurals in localisations

<- View Parent
julian@community.nodebb.org@community.nodebb.org ⁨1⁩ ⁨day⁩ ago

For Developers

There's no requirement to support pluralized strings in your templates — they are opt-in, but they are fairly easy to support.

Where you would normally write a translation string like so:

{
  ...
  "foo": "%1 bar(s)"
  ...
}

You will instead put in an "ICU Plural" string that looks like this:

{
  ...
  "foo": "{count, plural, one {{count} bar} other {{count} bars}}"
  ...
}

Comma separated:

original
Sort:hotnewtop