Repository navigation
chore(deps): update i18next-cli to v1.93.1 - #3721
Merged
Merged
Conversation
renovate
Bot
force-pushed
the
renovate/i18next-cli-1.x
branch
from
November 24, 2026 23:14
74a32be to
e9fa325
Compare
setchy
approved these changes
Nov 25, 2026
renovate
Bot
force-pushed
the
renovate/i18next-cli-1.x
branch
from
November 25, 2026 01:17
e9fa325 to
83078c2
Compare
renovate
Bot
force-pushed
the
renovate/i18next-cli-1.x
branch
from
November 25, 2026 01:23
83078c2 to
0b9f0c3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
1.87.0→1.93.1Release Notes
i18next/i18next-cli (i18next-cli)
v1.93.1Compare Source
Object.prototypemembers (constructor,toString,valueOf,page.constructor.title) are written like any other key instead of being dropped, written flat or reported as anesting conflict, and a
__proto__key no longer writes toObject.prototype(#334, thanks @zzoraemon043).
v1.93.0Compare Source
setupplugin hook receives the plugin context (config,logger), aslintSetupandinstrumentSetupdo, so a plugin can read the i18next-cli config (locales,extractoptions) instead of takingthe same options again. Plugins whose
setuptakes no argument keep working. Fixes#333.
v1.92.0Compare Source
.astro,.vue,.svelte, …) is linted the wayextractreads it. What a plugin'slintOnLoadreturns for it is parsed as TSX, so a plugin can hand the linter TypeScript and JSX; before, it was parsedas plain JavaScript. A file no plugin returns code for is skipped, with the same warning
extractgives when itsextension is in
extract.input, instead of failing with a syntax error. Withi18next-cli-plugin-astro,
lintnow checks.astrofiles.Linteris exported from the package root, as the README's Advanced Usage section shows. It is anEventEmitter, so the example now listens withlinter.on('progress', …).lngfromnavigator.language, matched againstsupportedLngs(the config'slocales), sode-DEshows German. Before,lngwas a comment and the app showed
fallbackLngonly.© 2026 Ledgerly. All rights reserved.becomesledgerlyAllRightsReserved) and says a word once when a placeholder is named like the word next to it (You have {unpaid} unpaid invoices.becomesyouHaveUnpaidInvoices).v1.91.3Compare Source
or unused parameter is now reported outside the default namespace too:
useTranslation('home'),t('home:greeting'),t('greeting', { ns: 'home' })and selector calls, with akeyPrefix, in a mergedsingle-file output and with
defaultNS: false. Before, only the default namespace's file was read, so these callswent unchecked. The default namespace is
extract.defaultNS(translationwhen unset) like inextract;lintnolonger falls back to a
common.jsonordefault.json. The variables of every plural form of a key count.v1.91.2Compare Source
.astrofile inextract.inputthat no plugin handles names the fix: the newofficial i18next-cli-plugin-astro, which lets
extractandstatusfind the keys in.astrofiles.v1.91.1Compare Source
$t()option whose name only containscountorcontext({"discount": 5},{"subcontext": "vip"}) is no longer read as a plural or context reference, soextractkeepspriceinstead ofwriting empty
price_one/price_other, andremoveUnusedKeysno longer drops the existing translation(#332, thanks @zzoraemon043).
t()call in a comment are read by their whole name too:// t('price', { discount: 5 })no longer extracts
price_one/price_other,{ subcontext: 'vip' }no context key and{ dns: 'other' }noothernamespace. A quoted name ({ "count": 2 }) now counts like an unquoted one.v1.91.0Compare Source
<Trans>tags of a translation that miss the component's children are reported, with file, lineand
ns:key.<Trans>numbers its children, text included, so the{' '}a formatter inserts at a line breakshifts every later index: in
Each reminder needs{' '}<Bold>a contact</Bold>,<Bold>is<2>, and atranslation with
<1>a contact</1>rendersEach reminder needswithout an error anywhere. The tags of theprimary language (context and plural forms included) are resolved like react-i18next does at runtime, and a tag
on a text child, past the last child, empty on an element with text, or with content on a
<br/>is reported.A
<Trans>withcomponentsis skipped. Configure withlint.checkTransIndices('warn'by default).Fixes #331.
at the end of a line inside<Trans>is a child of its own, as Babel and SWC compileit, and takes an index in the default value. It was dropped like formatting whitespace, so every later index
was one too low:
Price ⏎<b>x</b> ⏎<em>y</em>extracted<2>y</2>, which renders the space insteadof
y.v1.90.0Compare Source
Found by running
init,instrument,extract,lintandstatuson the next-i18next examples, on copies ofthem with their texts hardcoded again (to compare the rewrite with the hand-written original) and on hardcoded
Next.js apps, and reading every rewrite.
next-i18next:
next-i18next's calls by where each file renders, from the import graph (
'use client',app/,pages/,imports relative, through the tsconfig or jsconfig
pathsand from the project root):const { t } = await getT()in Server Components, which becomeasync(a return type becomesPromise<…>),useT()fromnext-i18next/clientin Client Components,useTranslationfromnext-i18next/pagesin the Pages Router.Server Components got
useTranslation()before, a client hook that fails there. A Next.js app with i18next orreact-i18next and no next-i18next keeps
react-i18next.<Trans>in a Server Component getst={t} i18n={i18n}and comes fromreact-i18next/TransWithoutContext;getTcomes from the module the app imports it from (its owncreateServerI18nextfile) when that is notnext-i18next/server.generateMetadata()and other async functions of a Server Component file getgetT(), andexport const metadata = { title: '…' }becomesexport async function generateMetadata ()returning it.They got
i18next.t()before, which next-i18next does not initialize.render (no
tworks in both) unless they gett(andi18nfor a<Trans>) as props, files no routeimports, texts outside components, API routes, Server Actions and cached functions (
'use server','use cache'), Server Components wrapped inmemo()/forwardRef(), and language switches, whichnext-i18next makes through the route or
useChangeLanguage()(a call of that switch goti18n.changeLanguage()added before).i18n.tsinit file and no import of it in_appor the root layout for next-i18next, whichsets i18next up itself; the setup steps are printed when it is not set up yet, and the pages that load no
translations (no
serverSideTranslations()in them or in a helper they import) are named.(
{app,components}/**/*rather thansrc/**/*, where a Next.js app withoutsrc/has no file),next-i18next's
defaultNS(commonunless its config says otherwise, soextractwrites the keys ofuseT()to the namespace next-i18next loads),
messageFormatfor i18next-icu or i18next-mf2, andkeySeparator: falsefor flat keys with dots, which
extractnested before.lintandstatuswithout a config detect the same.Any React app:
'use client'directive in a file without imports, which ends thedirective.
t(const { i18n } = useT('ns'))got a second hook call;
tnow comes from that call and its namespace (const { t, i18n } = useT('ns')),unless a text comes before the call.
tfrom a translation hook (a custom hook,generateMetadatawithgetT()) goti18next.t(); atfromgetFixedT()counted as atof another kind.valuesofIcuTrans,IcuTransWithoutContextandTransWithoutContextweretranslated (
values={{ name: t('ada', 'Ada') }}).<hr />,<br />) went into its<Trans>.next-i18next v{pkg.version}was split into at()of its first part: a word with digitsin a later part (
i18next) now counts as a word beside a placeholder.Françaisgavefranais)..tsfile with it ("Parsed … using JSXfallback"), which is common enough to need no note.
--watchon a glob that starts with a brace group ({app,components}/**) watched the wholeproject,
.nextand.gitincluded.v1.89.0Compare Source
Found by running
instrument,extract,lintandstatuson a React monorepo whose texts are hardcoded (fourpackages, about 900 files) and reading every rewrite.
Code it broke:
useTranslationimported orconst { t }declared twice: a component with atof its own(a prop, or a hook from a module that re-exports it) gets no second one, and no name the file imports already
is imported again. "Has useTranslation" was a text search of the component body.
'a b': 1becamet(…): 1, a syntax error).import … fromlines got them.language,lang,localeorlngproperty (return fetchDownloads({ lng })becamereturn i18next.changeLanguage(…); fetchDownloads(…), aconstor anifbody lost its call) and repeated computed expressions. It now goesonly before a call that is a statement of its own in a block or an arrow body, with a plain variable or
property as the language, for a setter or a settings, profile or user call;
--dry-runlists the sites.${}failed the whole file.count === 1 ? … : …ternary over CSS values or class names became a pluralt().'-style entities in the default value, and a spaceat the edge of a sentence (
provider:{' '}<strong>) was dropped.includes()/indexOf()arguments,===operands,casevalues, and a string the file uses as data elsewhere (order: ['2FA', 'no 2FA']).peerDependenciesor in the workspace root was not found, so everytext got
i18next.t().localizeandinitread the same declared packages.i18nextorreact-i18nextalready.Any
.init(in the sources (Sentry.init()) prevented it before.tis something else (const [t, setT] = useState(0)) keeps its texts,reported in a warning; one with a
tprop that needsi18nfor a language switch gets its own hook.Texts it found wrongly or missed:
template literals, technical property values (
Authorization,id,type,code, …), camelCaseidentifiers, validation rules, strings without letters, code snippets, CSS values,
console.*calls andvariables only logged, logger and error-report calls,
new Error()andRegExparguments, format patterns(
.format('DD MMM YYYY')), event names (emit,on), selectors, analytics event names, icon ligatures,prompts for a language model
(
getSystemPrompt,aiAssistantPrompt), the content of<code>,<script>,<style>, and stories, mocksand fixtures by default.
data-tipanddata-tooltip-content) and in what an element renders from an expression; both branches of atext ternary; strings passed last to a call (
toast('Saved.')), taken as instrumented before; text in JSX andhandlers passed to attributes that are not text (
action={<Button>…</Button>},onClick). The project's ownextract.functionsandtransComponentscount as instrumented.plural(n, '# file', '# files')andpluralize/pluralisecalls, also inside template literals and JSX sentences, become one
t()withcount.<Trans>),{' '}, a valueformatted by a string method or a formatter, a choice between values; a button stays out.
_,<Trans>keys come from the words, placeholders are named after what they show(
format.date(user.lastLogin)→{{lastLogin}}), the same expression twice is one placeholder, and keys thecode uses already are not reused for another text nor made the parent of nested ones.
() => <p>…</p>) gets the hook instead ofi18next.t();tjoins the dependencies of auseMemo/useCallbackwhose callback calls it;<Trans>takes the quotes of the file's JSX attributes.
--dry-runlists each text with its key and each language-change site; a warning for manyfiles is printed once with the files below it; a candidate that cannot be rewritten is reported.
data-tip,data-tooltipanddata-tooltip-content(tooltip libraries) are in the recommendedtranslatable attributes, so
lintreports a hardcoded tooltip too.parent of nested keys is named as such.
v1.88.1Compare Source
Omit,Pick,Partial,Required,ReadonlyorNonNullableresolve their members.
t(`barStatus.${bar.status}`)withtype Bar = Omit<Foo, 'type'>extractednothing before unless the value was retyped as
Foo['status']. Omit and Pick drop or keep the namedmembers. Fixes #330.
v1.88.0Compare Source
acceptedAttributesalso takes an object that sets the translatable attributesper JSX element, e.g.
{ '*': ['!label'], Button: ['label'], 'Select.Option': ['hint'] }: a name addsan attribute to the recommended list,
!nameremoves it,'*'applies first. The same prop name canmean different things on different components (
labelis a button's text but a chart axis's datakey). Set in
extract, the rules apply tolintand now also toinstrument; the array form isunchanged. See "Translatable attributes per element" in the README.
t()or<Trans>key appears more than once, a default given in source(
t('key', 'Text'),defaults="...") now wins over<Trans>children, and both win over a fallbackbuilt from the key, whatever the order of files and calls; an empty default (
'') beats only thekey fallback, never text. An empty
<Trans i18nKey="ns:key" />no longer blocks the text of a later<Trans>. A default equal to the key now counts as a source default:t('key', 'key')keeps itsvalue next to
t('key', 'Text')(the first one wins), andwarnOnConflictsflags the pair.warnOnConflictsno longer flags a plural key without a default. Plugins get where a default camefrom in the new optional
ExtractedKey.defaultValueSource.(#329, thanks @skoeva).
default.
t('key', '')andt('key', { defaultValue: '' })write""instead of the key, sincei18next 27 returns
''for them (plural forms included).<Trans defaults="">still writes itschildren or the key, which is what react-i18next falls back to.
(
npx i18next-cli localize --print-agent-prompt).Configuration
📅 Schedule: (UTC)
* 0-3 * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.