eloqnt/studiov0.6
Navigation

Lint rules

inconsistent-args

error

Flags a translation whose ICU placeholders don't match the source message.

Why this is bad

Placeholders are the contract between your code and a message. A translation that drops one may needlessly generalize the sentence, and one that invents a placeholder will throw at runtime.

Examples

Given the source message "You have {count, number} new messages".

Examples of incorrect code for this rule:

messages/es.json

{
"messages": "Tienes mensajes nuevos"
}

Examples of correct code for this rule:

messages/es.json

{
"messages": "Tienes {count, number} mensajes nuevos"
}