Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: enable i18next plurals #2743

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

naglis
Copy link
Contributor

@naglis naglis commented Jan 1, 2025

Addresses: #2660

Use the count placeholder name for strings which might have different translations depending on the number of results, which enables nicer messages, e.g. "1 match" instead of "1 match(es)".

count is the reserved placeholder for plural forms used in i18next.

Translations can use different suffixes to provide the right messages for all the plural forms applicable to that language. To find out which suffixes should be used for a particular language, this JSFiddle can be used.

NOTE: GitLocalize most likely will not support the extra plural forms in different languages, so in order to add/modify them, the translator will have to make PRs. Also, i18next-json-sync (the CLI tool to extract translatable strings) does not support plural keys (it simply removes them). See #2660 for more information.

naglis added 3 commits January 1, 2025 12:42
Use the `count` placeholder name for strings which might have different
translations depending on the number of results, which enables nicer
messages, e.g. "1 match" instead of "1 match(es)".

`count` is the reserved placeholder for plural forms used in i18next[1].

Translations can use different suffixes to provide the right messages for
all the plural forms applicable to that language. To find out which
suffixes should be used for a particular language, this JSFiddle[2] can
be used.

[1]: https://www.i18next.com/translation-function/plurals
[2]: https://jsfiddle.net/6bpxsgd4
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.

1 participant