Sourced from i18next-cli's changelog.
1.80.0
- feat(lint): in the i18next format, the translation files of every locale are compared with the primary language: interpolations by name (
{{name}},{{- name}},{{val, number}}), nested$t(key)references and tags (<0>,<1/>,<bold>), except the basic HTML react-i18next keeps (transKeepBasicHtmlNodesFor). A translation that renamed or dropped a placeholder is reported with file, key and line, e.g.greeting: missing {{name}}, unexpected {{nom}} (compared with "en"). Plural forms are compared as a group, so{{count}}may be left out of_oneor_zero. A warning by default, so existing CI runs keep passing;lint.checkTranslationPlaceholders: 'error'fails the run,'off'disables it. Until now only ICU and MF2 projects had this check.- feat(status): values identical to the primary language (English copied into
de) are marked≈ (identical to en)and counted in the summary.status.checkIdentical:'warn'(default) still counts them as translated and keeps the exit code,'error'counts them as untranslated,'off'disables it. Locales of the primary's language (en-GBwithen), values without letters, URLs, e-mail addresses and short all-caps words (OK,FAQ) are skipped; other values that stay the same go intostatus.ignoreKeys.- feat(lint):
lint --update-baselinewrites the current issues toi18next-lint-baseline.json(lint.baselinefor another path). While the file exists,lintreports and fails only on new issues, so a codebase with existing hardcoded strings can runlintin CI. Issues are matched by file, type and text, not by line.- fix(lint): interpolations are read like i18next does. The unescaped
{{-name}}was read as a parameter-name, sot('Hi {{-name}}', { name })reported two false interpolation issues;{{- name}}and names outside[A-Za-z0-9_.-]({{größe}}) were not read at all.- docs(types):
transKeepBasicHtmlNodesFordefaults to react-i18next's['br', 'strong', 'i', 'p'].- docs(skill, localize): after translating by hand, run
lintto check the placeholders.1.79.1
- fix(init, migrate-config): the default source glob includes
.mjs(src/**/*.{js,jsx,mjs,ts,tsx}), ininit, in the config detected for a project without one, and inmigrate-configwhen the old config has noinput. Existing configs do not change. #3091.79.0
- feat(extract, instrument, lint): a
.mjsfile with JSX is parsed with the same JSX fallback as a.jsfile, including the constants pre-scan ofextract. Before, it failed with a syntax error andextractexited with 1. #3091.78.0
- feat(lint): with
messageFormat: 'mf2',lintwarns when whitespace at the start or end of a pattern differs from the primary language. MF2 keeps a space inside{{ }}as text, so{{ {$count} files}}shows it in the app. A warning does not fail the run.- fix(lint): a language code with
_(ru_RU,pt_BR) is read asru-RU,pt-BRfor the plural categories. Before,Intlrejected it and onlyotherwas required, so aru_RUplural with onlyoneandotherpassed.- fix(lint): the required plural categories are
otherplus every category a whole number below one million selects (was 0 to 1000), the same rule as Locize; exact selectors count for a category only when it selects a few small numbers. No locale's result changes with today's CLDR data.- docs(skill): the ICU and MF2 reference names the common MF2 plural mistakes:
otherinstead of*,{{ {$count}instead of{{{$count}, and spaces inside{{ }}.
6a339b2
1.80.03f5ffd9
feat(lint, status): placeholders across locales, identical values, lint
baseline73b085d
1.79.1f479d53
fix(init, migrate-config): include .mjs in the default source globee7b1aa
1.79.07c95544
fix(extract): JSX fallback for .mjs in the constants pre-scan tood320c6a
feat(extract, instrument, lint): support .mjs files with JSX (#309)20524b8
1.78.0462ed40
feat(lint): MF2 pattern-edge whitespace warning, _ language
codes, plural r...