marmelab/react-admin · warning

A message contains more than two plural forms so we can not

Error message

A message contains more than two plural forms so we can not convert it to i18next format automatically. You should provide your own translations for this language.

What it means

convertRaTranslationsToI18next converts react-admin's ' |||| ' plural syntax to i18next's _one/_other keys, which supports at most two variants. When a message contains three or more plural forms (common in Slavic languages with plural cases), automatic conversion is impossible and the converter warns, keeping only the first two variants.

Source

Thrown at packages/ra-i18n-i18next/src/convertRaTranslationsToI18next.ts:51

    return Object.keys(raMessages).reduce((acc, key) => {
        if (typeof acc[key] === 'object') {
            acc[key] = convertRaTranslationsToI18next(acc[key], {
                prefix,
                suffix,
            });
            return acc;
        }

        const message = acc[key] as string;

        if (message.indexOf(' |||| ') > -1) {
            const pluralVariants = message.split(' |||| ');

            if (
                pluralVariants.length > 2 &&
                process.env.NODE_ENV === 'development'
            ) {
                console.warn(
                    'A message contains more than two plural forms so we can not convert it to i18next format automatically. You should provide your own translations for this language.'
                );
            }
            acc[`${key}_one`] = convertRaTranslationToI18next(
                pluralVariants[0],
                {
                    prefix,
                    suffix,
                }
            );
            acc[`${key}_other`] = convertRaTranslationToI18next(
                pluralVariants[1],
                {
                    prefix,
                    suffix,
                }
            );
            delete acc[key];

View on GitHub (pinned to 051f511bb0)

Solutions

  1. Provide your own i18next-format translations for that language instead of auto-converting.
  2. Manually split multi-form messages into _one/_other/_few keys in i18next format with proper plural rules.
  3. Preprocess the source JSON to reduce messages to two variants before conversion if approximation is acceptable.

Example fix

// before (source message)
"%{smart_count} comment |||| %{smart_count} comments |||| %{smart_count} komentarzy"
// after (hand-written i18next)
"comments_one": "%{smart_count} comment",
"comments_other": "%{smart_count} comments" // plus custom plural rule for the language
Defensive patterns

Strategy: validation

Validate before calling

const messages = require('./ru.json');
const bad = Object.entries(messages).filter(([, v]) => String(v).split(' |||| ').length > 2);
if (bad.length) console.warn('Manual i18next translation needed for:', bad.map(([k]) => k));

Prevention

When it happens

Trigger: Running convertRaTranslationsToI18next on a translation file whose messages contain 'a |||| b |||| c' (three-plus segments separated by ' |||| ').

Common situations: Migrating a Russian, Polish, Ukrainian, Czech, etc. translation package from ra-language-* to the i18next provider.

Related errors


AI-assisted analysis of marmelab/react-admin@051f511bb0 (2026-08-30). Data as JSON: /api/errors/c64f6cb3392938bd. Report an issue: GitHub.