plural-branches
Warning · A plural of vue-i18n does not have the branches of the source.
git8n check reports this rule as a warning. It fails only past --max-warnings.
Why it matters
vue-i18n picks a branch of no car | one car | {count} cars by the number of its branches: with 2, the first is for 1; with 3, the first is for 0 and the second for 1. A translation with other branches shows the wrong one. Only a source with branches is read as a plural, and a text with an ICU choice is never one. The rule runs with --syntax vue-i18n only.
Invalid
locales/en/common.json
{
"cars": "no car | one car | {count} cars"
}locales/fr/common.json
{
"cars": "une voiture | {count} voitures"
}$ git8n check --source en --syntax vue-i18n
locales/fr/common.json
warning common:cars: 2 branches, and the source has 3. plural-branches
Read more:
plural-branches https://git8n.sakuga.dev/docs/reference/rules/plural-branches.html
0 errors, 1 warning in 2 files (en → fr, 1 key).Valid
locales/en/common.json
{
"cars": "no car | one car | {count} cars"
}locales/fr/common.json
{
"cars": "aucune voiture | une voiture | {count} voitures"
}$ git8n check --source en --syntax vue-i18n
0 errors, 0 warnings in 2 files (en → fr, 1 key).What to do
Write as many branches as the source, separated by |. Write {'|'} for a | that is text. If the application sets pluralRules for this language, its number of branches can differ: --max-warnings lets a number of warnings pass.