Comment on Improving support for plurals in localisations
julian@community.nodebb.org@community.nodebb.org 1 day ago
For translators
This means that any converted strings have lost their existing translations. You will need to manually go in and translate them again (plus their plural variants), or rescue the existing translation from the history.
However, note that for plural strings, there is a new placeholder {count} to be used in addition to the %1, %2, etc. that we already use. We use {count} for simplicity, but it could be named anything.
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:
You will instead put in an "ICU Plural" string that looks like this:
Comma separated:
countis the variable substitution you'll use in the latter half of the stringpluralis hardcoded, it's alwayspluralonedenotes the singular form in the proceeding bracesotherdenotes the plural form (in English) in the next set of braces