We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using a single count inside a nested key will apply the same count to all other following nested key without their own count.
Issue occurs also with v3 json syntax.
Codesandbox
import i18n from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; i18n .use(LanguageDetector) .init({ debug: true, fallbackLng: "en", resources: { en: { translation: { item_one: "item", item_other: "items", thing_one: "thing", thing_other: "things", phrase: 'A: $t(thing, { "count": 2 }) B: $t(item)', } } }, }); console.info(i18n.t("phrase")); export default i18n;
At the moment both A and B got plural variant:
A: things B: items
The expected behaviour is that only A is returned with its plural variant. B uses single variant.
A: things B: item
As a workaround you can explicit count on B:
phrase: 'A: $t(thing, { "count": 2 }) B: $t(item, { "count": 1 })',
The text was updated successfully, but these errors were encountered:
not providing a count will result in resolving "other" -> so omitting the count will not result in singular but plural (other)...
Sorry, something went wrong.
269421c
v22.0.8 should fix that
adrai
No branches or pull requests
🐛 Bug Report
Using a single count inside a nested key will apply the same count to all other following nested key without their own count.
Issue occurs also with v3 json syntax.
To Reproduce
Codesandbox
Expected behaviour
At the moment both A and B got plural variant:
The expected behaviour is that only A is returned with its plural variant. B uses single variant.
As a workaround you can explicit count on B:
Your Environment
The text was updated successfully, but these errors were encountered: