Sourced from i18next-cli's changelog.
1.77.0
- feat(types): with
extract.messageFormat: 'icu'or'mf2', a newly generatedi18next.d.tssetsparseInterpolation: 'icu'or'mf2'when the project's i18next is 26.5.0 or later, sot()options are type-checked against the arguments of each message. With i18next 26.2.0 to 26.4.x it still setsparseInterpolation: false. The version is read fromnode_modules/i18next/package.json, from the working directory upwards (hoisted monorepo installs count); without an installed i18next it staysfalse. The warning for an existingi18next.d.tswithoutparseInterpolationsuggests the value for your i18next version, and an existing file that still setsfalsealthough your i18next supports the typed value gets a hint.- docs(skill): the ICU and MF2 reference describes
parseInterpolation: 'icu'/'mf2'.1.76.0
- feat: new
extract.messageFormatoption,'i18next'(default),'icu'(i18next-icu) or'mf2'(i18next-mf2), for the syntax of your translation values.- feat(extract): with
messageFormat: 'icu'or'mf2',extractwrites one key per message.t('photos', '{count, plural, ...}', { count })gavephotos_oneandphotos_other(plus_fewand_manyfor languages like Polish), keys i18next-icu and i18next-mf2 never read, andcontextgave_malekeys; now it givesphotos.$t()in a value is no longer read as nesting, and the children of<Trans>are written with{name}(ICU) or{$name}(MF2) instead of{{name}}, which ICU and MF2 rendered as text.- feat(extract):
IcuTransandIcuTransWithoutContextare extracted, also when imported under another name (key fromi18nKey, ordefaultTranslationwhen there is none), and so are theTrans,Plural,SelectandSelectOrdinalcomponents ofreact-i18next/icu.macro, with the message the macro builds (<Trans>Welcome, <strong>{name}</strong>!</Trans>givesWelcome, <0>{name}</0>!). Before,IcuTranswas not extracted, and the macro<Trans>was read as react-i18nextTransand written asWelcome, <strong>{{name}}</strong>!, which the compiledIcuTransrendered as text.- feat(status): with
messageFormat: 'icu'or'mf2', a plural or select message counts as one key, sostatusno longer reports missing_fewand_manykeys.- feat(instrument): with
messageFormat: 'icu'or'mf2',instrumentwrites{name}/{$name}placeholders, acount === 1 ? … : …ternary becomes one plural message instead ofdefaultValue_one/defaultValue_other, and the i18n init file it creates registersi18next-icu(withintl-messageformatin the install hint) ori18next-mf2.- feat(extract, instrument): with
messageFormat: 'icu'or'mf2', the text around converted placeholders (Transvalues,instrument) is escaped:File '{{name}}' not foundbecomesFile ''{name}' not found, because an apostrophe before{starts quoted text in ICU and'{name}'would render as the text{name}; literal braces are quoted (ICU) or escaped (MF2).- feat(lint): with
messageFormat: 'icu'or'mf2',lintparses every value in the translation files of all locales and reports, with file, key and line (JSON files):
- syntax errors with the parser's message (
greeting: ICU syntax error: EXPECT_ARGUMENT_CLOSING_BRACE at column 7), with a hint when the value contains i18next's{{- argument names that differ from the primary language, so a renamed or missing
{name}is caught (#is not an argument)- plural categories that do not fit the locale, for
pluralandselectordinal(MF2:.matchon:numberor:integer). Allowed are the locale's CLDR categories, required areotherplus every category a whole number from 0 to 1000 selects:runeedsone,fewandmany, whilefr,es,itandptmay leave outmany(only from 1,000,000) andcsitsmany(fractions only), andzeroinenis reported as never used. Exact selectors like=0are allowed and count for a category when they cover every whole number it is used for (=1coversoneinen, not inru, whereoneis also 21, 31, ...). For a localeIntldoes not know onlyotheris required.- fix(lint): with
messageFormat: 'icu'or'mf2', thet()interpolation check reads the arguments with the same parser. ICU braces likemale {{name}}are no longer taken for{{name}}interpolation (which reported thegenderpassed to a select as unused), andt('greeting', 'Hello {name}', { nmae })is reported.- feat(types): with
messageFormat: 'icu'or'mf2', a newly generatedi18next.d.tssetsparseInterpolation: false(i18next 26.2.0+), so ICU and MF2 plurals no longer break the type-safet. For an existing file without it,typesprints a warning.
... (truncated)
933364e
1.77.02916f1b
update i18next depsb7d07e7
feat(types): write parseInterpolation 'icu' / 'mf2' for i18next 26.5.0
or later71194cc
test(lint): platform paths in the ICU/MF2 lint tests, so they pass on
Windows1ea8328
1.76.0faa93a3
fix(extract, instrument): escape ICU/MF2 text, register the plugin in
the ini...a87f01f
feat(extract, status, instrument): one key per ICU/MF2 message, IcuTrans
and ...e9b1f56
feat(lint, types): ICU and MF2 support with the new
extract.messageFormat option6d2202d
README: add Awesome Claude Code badge next to the skill install
badge