terriajs icon indicating copy to clipboard operation
terriajs copied to clipboard

Wrong plural translation

Open irbian opened this issue 7 months ago • 1 comments

Don't know where the problem comes from, if on the file or on the weblate, but there is a discrepancy on the keys that implies it doesn't translate properly

This two https://github.com/TerriaJS/terriajs/blob/main/wwwroot/languages/es/translation.json#L606 https://github.com/TerriaJS/terriajs/blob/main/wwwroot/languages/es/translation.json#L39C6-L39C25

In english:

    "searchMinCharacters": "You need to enter minimum {{count}} character",
    "searchMinCharacters_plural": "You need to enter minimum {{count}} characters",

In spanish:

    "searchMinCharacters_0": "Necesita introducir al menos {{count}} carácter",
    "searchMinCharacters_1": "Necesita introducir al menos {{count}} caracteres",
    "searchMinCharacters_2": "Necesita introducir al menos {{count}} caracteres"

In weblate https://hosted.weblate.org/translate/terriajs/terriajsnext/es/?q=searchMinCharacters&sort_by=-priority%2Cposition&checksum=

irbian avatar Jun 05 '25 13:06 irbian

It is expected to have different keys, when there is count i18next looks for proper plural variation. In English there is only singluar and plural but other languages and usually more complex. You can find more details in i18n docs https://www.i18next.com/translation-function/plurals

Are you seeing an issue somewhere in UI with plurals?

zoran995 avatar Jun 06 '25 07:06 zoran995