Skip to content

i18n: enable i18next plurals#2743

Merged
danielweck merged 4 commits intoedrlab:i18next-pluralsfrom
naglis:enable-i18next-plurals
Jan 14, 2026
Merged

i18n: enable i18next plurals#2743
danielweck merged 4 commits intoedrlab:i18next-pluralsfrom
naglis:enable-i18next-plurals

Conversation

@naglis
Copy link
Copy Markdown
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 naglis force-pushed the enable-i18next-plurals branch 2 times, most recently from 9d9995a to 5a794a0 Compare January 9, 2025 16:39
@naglis naglis force-pushed the enable-i18next-plurals branch 3 times, most recently from 6168b92 to 3f54390 Compare January 31, 2025 16:35
@danielweck danielweck marked this pull request as draft January 31, 2025 18:56
@naglis naglis force-pushed the enable-i18next-plurals branch 5 times, most recently from 8378bff to c5142f2 Compare February 6, 2025 20:04
@naglis naglis force-pushed the enable-i18next-plurals branch 2 times, most recently from 7c60374 to 9ee0c40 Compare February 19, 2025 17:01
@danielweck
Copy link
Copy Markdown
Member

thank you for keeping this up to date :)
we'll be discussing soon.

@danielweck
Copy link
Copy Markdown
Member

Fixes #2660

@naglis naglis force-pushed the enable-i18next-plurals branch 2 times, most recently from 6d4471a to 1ad8878 Compare February 26, 2025 16:58
@naglis naglis force-pushed the enable-i18next-plurals branch 2 times, most recently from 78ded49 to 312d743 Compare March 10, 2025 16:52
@naglis naglis force-pushed the enable-i18next-plurals branch 4 times, most recently from 668a42f to 71c6307 Compare March 23, 2025 11:34
@naglis naglis force-pushed the enable-i18next-plurals branch from 71c6307 to 6ee475e Compare April 11, 2025 19:14
@naglis naglis force-pushed the enable-i18next-plurals branch from 6ee475e to 5099433 Compare May 11, 2025 13:03
@naglis naglis force-pushed the enable-i18next-plurals branch from 5099433 to b05be1a Compare August 2, 2025 09:30
@naglis naglis force-pushed the enable-i18next-plurals branch from b05be1a to 0ba6f2e Compare August 11, 2025 19:16
@naglis naglis force-pushed the enable-i18next-plurals branch from 0ba6f2e to 11a6e8a Compare August 21, 2025 15:56
@naglis naglis force-pushed the enable-i18next-plurals branch 2 times, most recently from 4bf2e45 to cc88948 Compare October 7, 2025 20:10
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
@naglis naglis force-pushed the enable-i18next-plurals branch from cc88948 to df67e9b Compare October 13, 2025 09:48
@danielweck danielweck self-assigned this Jan 6, 2026
@danielweck danielweck self-requested a review January 6, 2026 10:53
@danielweck danielweck changed the base branch from develop to i18next-plurals January 14, 2026 20:53
@danielweck danielweck marked this pull request as ready for review January 14, 2026 20:53
@danielweck danielweck merged commit d96e8cb into edrlab:i18next-plurals Jan 14, 2026
8 checks passed
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.

3 participants