eloqnt/studiov0.6
Navigation

Lint rules

inconsistent-exact-plurals

error

Flags a translation whose exact plural cases (e.g. "=0") differ from the source.

Why this is bad

An exact case matches one literal number rather than a CLDR category, so it answers to the source rather than to the locale (e.g. to implement empty states).

Examples

Given the source message "{count, plural, =0 {No files} one {1 file} other {# files}}".

Examples of incorrect code for this rule:

messages/es.json

{
"files": "{count, plural, one {1 archivo} other {# archivos}}"
}

Examples of correct code for this rule:

messages/es.json

{
"files": "{count, plural, =0 {Sin archivos} one {1 archivo} other {# archivos}}"
}