Skip to main content
shipi18n logo|Documentation

plural-forms: plural forms lost in translation

error — fails the build

A pipe-separated plural ("{count} filter | {count} filters") came back with the wrong number of forms. It is an error when the separator was lost and both sentences sit in one string, or when the count of forms fits neither the source nor the language. A single form that keeps the right variables is reported as a warning: every count reads the same, which is grammatically off for some counts but breaks nothing.

What triggers it

// en.json
{ "filterCount": "{count} filter | {count} filters" }

// sv.json — the | came back as <unk>, so both sentences render together (error)
{ "filterCount": "{count} filter <unk> {count} filter" }

// es.json — one form for every count (warning)
{ "filterCount": "{count} filtros" }

Fixed

// sv.json
{ "filterCount": "{count} filter | {count} filter" }

// es.json
{ "filterCount": "{count} filtro | {count} filtros" }

Why it matters

Machine translation often treats | as ordinary text: nocodb fixed 182 strings in 13 languages where it came back as <unk>, ●, + or a full-width |, and users saw both forms run together. Not reported: languages with a single plural category (Chinese, Japanese, Korean…) using one form, and apps whose own vue-i18n pluralRules give a language more forms than English (Arabic 6, Polish 5).

How to fix it

Put a plain | between the forms, one form per plural category the app uses. The fix hint names the number of forms the source has.

How to silence it

--severity 'plural-forms=warning' to stop failing CI on it, or --ignore-keys 'path.to.key' for one key.

Check for this in CI

npx @shipi18n/cli check ./locales -s en
# SARIF for inline PR annotations:
npx @shipi18n/cli check ./locales -s en -r sarif -o shipi18n.sarif

The structural checks need no API key. Findings of this rule link back to this page from the SARIF helpUri.

What this looks like in your app

Related rules