Skip to content

feat(l10n): enable i18next plurals#3351

Merged
danielweck merged 5 commits intodevelopfrom
i18next-plurals
Jan 14, 2026
Merged

feat(l10n): enable i18next plurals#3351
danielweck merged 5 commits intodevelopfrom
i18next-plurals

Conversation

@danielweck
Copy link
Copy Markdown
Member

@danielweck danielweck commented Jan 14, 2026

Fixes #2660

Follow-up to PR #2743
We need to adapt the i18n tooling (check, scan, sort, typed)

Also see:
felixmosh/i18next-locales-sync#40
jwbay/i18next-json-sync#22

@danielweck danielweck merged commit 917e3f1 into develop Jan 14, 2026
8 checks passed
@danielweck danielweck deleted the i18next-plurals branch January 14, 2026 22:46
@danielweck
Copy link
Copy Markdown
Member Author

i18next compatibilityJSON v4

I fixed Weblate (was v3)

compatibilityJSON: "v4",

"i18n-scan": "node ./scripts/translate-scan.js \"src/resources/locales/und.json\" && i18next-locales-sync --compatibilityJSON v4 --localesFolder ./src/resources/locales/ --primaryLanguage und --secondaryLanguages en ta tr ar cs sl bg ca da de el es eu fi fr gl hr it ja ka ko lt nl pt-br pt-pt ru sv zh-cn zh-tw --spaces 4 --useEmptyString true && rimraf \"src/resources/locales/und.json\"",
"i18n-check": "i18next-locales-sync --compatibilityJSON v4 --localesFolder ./src/resources/locales/ --primaryLanguage en --secondaryLanguages ta tr ar cs sl bg ca da de el es eu fi fr gl hr it ja ka ko lt nl pt-br pt-pt ru sv zh-cn zh-tw --spaces 4 --useEmptyString true",

https://www.i18next.com/misc/json-format#i18next-json-v4

@danielweck
Copy link
Copy Markdown
Member Author

danielweck commented Jan 20, 2026

https://docs.weblate.org/en/latest/user/translating.html#plurals

https://www.i18next.com/translation-function/plurals

EN "one" "other"

"descList_one": "{{- count}} note {{- creator}} will be imported into '{{- title}}' {{- author}}",
"descList_other": "{{- count}} notes {{- creator}} will be imported into '{{- title}}' {{- author}}",

FR "one" "many" "other"

"descList_one": "{{- count}} note {{- creator}} sera importée vers {{- title}} {{- author}}",
"descList_many": "{{- count}} note(s) {{- creator}} seront importées vers {{- title}} {{- author}}",
"descList_other": "{{- count}} notes {{- creator}} seront importées vers {{- title}} {{- author}}",

Weblate: https://hosted.weblate.org/translate/thorium-reader/thorium-reader-translation/en/?checksum=57a2578b136eb3c1#translations

Confirmed by i18next tooling:

https://jsfiddle.net/6bpxsgd4

i18next and Weblate are consistent with the specification:

https://cldr.unicode.org/index/downloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i18n: Add support for plural forms

2 participants