Repository navigation
fix(deps): update dependency i18next to v27 - #69
Closed
renovate[bot] wants to merge 1 commit into
Closed
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/i18next-27.x
branch
5 times, most recently
from
November 25, 2026 07:03
5fd2b3a to
9e0f582
Compare
renovate
Bot
force-pushed
the
renovate/i18next-27.x
branch
from
November 25, 2026 17:32
9e0f582 to
820dbe3
Compare
Master3307
added a commit
that referenced
this pull request
Nov 25, 2026
- katex 0.18.2 (security fix) - i18next 27, react-i18next 18, dotenv 18, web-push 4, undici 8 (override) - three 0.187: Clock -> Timer, PCFSoftShadowMap -> PCFShadowMap (soft by shadow.radius now; the old type only logged a warning) - nodemailer 10.6.1, discord-api-types 0.38, unicode-emoji-json 0.9, capacitor 8.6.2, express-rate-limit 8.7.5, pnpm 12.23.0 Replaces #46, #50, #52, #53, #57, #58, #59, #63, #68, #69, #70, #71, #72, #73. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Included in |
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:
^26.7.2→^27.0.0Release Notes
i18next/i18next (i18next)
v27.2.9Compare Source
t('item', { count: 2n })picks the plural form instead of throwingTypeError: Cannot convert a BigInt value to a number: a BigIntcount(as some database drivers return forCOUNT(*)) is converted to a number forIntl.PluralRules,{{count}}still gets the BigInt, and0nlooks up_zerolike0. AboveNumber.MAX_SAFE_INTEGERthe form follows the rounded number. Thanks @Asimmimx (#2484)v27.2.8Compare Source
t()call withcontextlooks the key up along its own path in the namespace it names, instead of matching it against every key of every namespace. With several large namespaces each such call cost up to millions of type instantiations and could fail with TS2589, a literalcontext: 'x'soonest. A context value without a key is still an error, as since 25.9.0 (#2482)supportedLngs: ['en-US'],'EN'(from?lng=ENor a capitalised cookie) matches'en-US'like'en'and'EN-GB'already did, instead of falling back tofallbackLng, anddir('AR')returns'rtl'whereIntl.Localehas nogetTextInfo(). Thanks @anishkun (#2483)dir()also returns'rtl'for'AR'or'AR-EG'withcleanCode: falsewhereIntl.Localehas nogetTextInfo()(Node.js 22, some browsers)v27.2.7Compare Source
addResource, and with itsaveMissingwriting to the store, keeps a key below a number, a boolean or an array'slengthflat, like it already did below a string, instead of throwingCannot create propertyorInvalid array length. A request toi18next-http-middleware'smissingKeyHandlerwith{"a":5,"a.b":"x"}got a 500 from that throw.v27.2.6Compare Source
defaultValue: '':t('key', { count: 0, defaultValue_zero: '', defaultValue_other: '{{count}} items' })returns''instead of "0 items", and saveMissing saves''for a form given as''(key_zerotoo) instead of another form's text. A form without its own default savesdefaultValue, then theotherdefault, instead of the default resolved for the current count. Thanks @arba-octo (#2480)v27.2.5Compare Source
LoggerModule'slog,warnanderrortake one array, the way i18next calls them (log(args)); they were typed with rest parameters, so a logger typed to spread...argsgot the array as its only argument. Loggers typed either way still compile.I18nFormatModuledeclares the members i18next calls:init,parse,addLookupKeys,handleAsObjectandgetResource, all optional. It declared onlytype, so an object-literal i18n format with these members failed to compile.v27.2.4Compare Source
BackendModule.createtakes the parameters i18next passes it: a backend withcallbackApi: truegetscreate(languages, namespace, key, fallbackValue, callback, options), one withcallbackApi: falsegetscreate(languages, namespace, key, fallbackValue, options)and may return a promise. The types declared only the first four parameters, so a required fifth or sixth parameter failed to compile and an object-literal backend could not take them at all. One rare case now fails: acreate: (...args) => other.create(...args)that forwards to acreatetyped with exactly four parameters. The doc comments ofreadandreadMultinow describe their promise form (read(language, namespace)returning the data or a promise of it), which the types already accepted.getFixedT()takes its fourth parameter,{ scopeNs }, the full list of namespaces the returnedtis bound to, which selector keys use to find a namespace prefix; lookups still usens(react-i18next'suseTranslationpasses it).saveMissingPluralssays@default true, the runtime default since the option came in 10.3.0, notfalse.v27.2.3Compare Source
$t(key, { "name": "{{name}}" })is escaped once. With the defaultescapeValue: trueit was escaped for HTML before the options were parsed and again by the nestedt(), soTom & Jerrycame out asTom &amp; Jerry(and react-i18next'sTranshas shownTom & Jerrysince 17.1.10, withescapeValue: falsetoo). These variables are now escaped for the options' JSON, whateverescapeValueis, and the nestedt()escapes them like the values of a direct call;defaultValueandjoinArraysthere, which it does not interpolate, stay escaped once. A value with",',\or a line break no longer breaks the options, withescapeValue: falsea value can no longer inject options such aslng, and withskipOnVariablesa{{placeholder}}inside a value is no longer interpolated a second time. The warning added in 26.0.6 now covers{{- var}}in these options, the one form still inserted unescaped, instead ofescapeValue: false.v27.2.2Compare Source
setDefaultNamespace()works on a clone. A clone's translator keeps its own options object, so the call changedi18n.options.defaultNSwhilet()kept using the old default namespace. i18next-http-middleware hands every request a clone, soreq.i18n.setDefaultNamespace()did nothing there. (#2106)supportedLngsworks in any casing. Every other language code is formatted (pt-brtopt-BR,ENtoen, all lowercase withlowerCaseLng), butsupportedLngswas compared as written, sosupportedLngs: ['pt-br'],['EN'], or['pt-BR']withlowerCaseLng: truerefused that language and fell back. They are now compared in that formatted form (also byloadLanguages()), whileoptions.supportedLngsstays as written. (#1791)interfaces get their nested keys. The key types only walked into objects with an index signature, which a type alias has and an interface does not, sot('nested.key')failed with TS2345 whilet('nested')compiled. Interfaces now give the same keys as type aliases, sot('nested')withoutreturnObjectsis rejected for them too. (#2326)strictNullChecks: false. Without strict null checksundefinedpassesextends string, so the key prefix, namespace and context checks took a missingkeyPrefix,nsorcontextfor a value:t('title')was rejected (onlyt('ns:title')compiled),t()returnedstring, and react-i18next'sTransaccepted noi18nKey. A new type test project compiles withstrictNullChecks: false; with strict null checks the types resolve as before. (#2085)v27.2.1Compare Source
undefinedrenders as an empty string when its placeholder has a format too ({{amount, number}}), as{{amount}}already did. The placeholder stayed in the result with the defaultskipOnVariables: true, and debug mode logged "missed to pass in variable" with either setting. Thanks @Vineet829 (#2479)v27.2.0Compare Source
init,changeLanguage,loadNamespacesorloadLanguages, or alanguageChanged/loadedlistener) is no longer handed back to the backend connector as if the read had failed. With a backend whosereadreturns a value or a promise, the connector got that error a second time: the namespace that had loaded was marked as failed,failedLoadingwas emitted with your error and the count of running reads dropped to -1. The error now reaches your app: it is thrown from the call that started the load for areadthat returns a value, and it is an unhandled rejection for areadthat returns a promise, which ends a Node.js process unless you handleunhandledRejection. Thanks @SudeepGowda55 (#2477)loadedevent is still emitted, and the error is thrown on after that. A secondloadNamespaces()for the same namespace never called back before.addResourceBundle(lng, ns, resources, true, true)overwrites numbers and booleans too. Only strings were replaced, so{ n: 0 }stayed 0 after adding{ n: 5 }, and adding an object where the bundle had a number, boolean or null threwCannot create property ... on number, also withoutoverwrite. Withoverwrite, a number, boolean or null now also replaces a nested object, as a string already did. Thanks @SudeepGowda55 (#2476)keySeparator: false, a namespace separator inside the key after the namespace is kept.t('common:errors:required')looked up'errorsfalserequired'instead of the flat key'errors:required'that i18next-cli extracts (also for a selector like$ => $.common['errors:required']), and reported the missing key under that name. This dates back to 11.3. Thanks @SudeepGowda55 (#2478)v27.1.5Compare Source
off(event, listener)removes a listener added withonce().once()registers a wrapper, sooff()with the listener itself found nothing and the listener still ran on the next event. Aonce()listener is now also removed before it runs, so one that emits the same event again (like callingchangeLanguage()fromlanguageChanged) or throws runs only once. Thanks @SudeepGowda55 (#2475)v27.1.4Compare Source
enableSelector, assigning atfunction to a widerTFunction(TFunction<'ns'>toTFunction<'ns', string>orTFunction<Namespace>, or a key prefix to a wider one) failed with TS2590 "Expression produces a union type that is too complex to represent" once the namespaces had about 600 top-level keys together. This started in 26.3.3. Selector results for JSON arrays that mix arrays with objects or strings also keep the inner arrays as arrays. Thanks @reckter (#2474)v27.1.3Compare Source
hasOwnProperty,isPrototypeOf,toLocaleString,__defineGetter__, ...) made the backend connector throwobj[k].push is not a functionwhen its load finished. A language detector passes such a code on from a request (?lng=hasOwnProperty), and with an asynchronous backend nothing caught the throw, so one request ended a Node.js server process (in a browser,init()never resolved). Now these codes load like any other unknown language. Thanks @superbot-helper (GHSA-q76c-gcvw-89x9)fallbackLng, a language code named like anObject.prototypeproperty (constructor,toString,hasOwnProperty,constructor-US) gets thedefaultfallback instead of makingt(),exists(),getFixedT()andchangeLanguage()throwfallbackCodes.forEach is not a function. Thanks @cyphercodes (#2473, #2472)v27.1.2Compare Source
supportedLngs: false, every made-up language a detector found (?lng=xx1,?lng=xx2, ...) or every made-up namespace requested from i18next-http-middleware'sgetResourcesHandleradded about 180 bytes for good. Now only the most recent 1000 failed loads are kept (an older one is read again when it is needed), and both caches are emptied at 1000 codes, as the formatted language codes already were. Pairs with i18next-http-middleware 3.10.1 (GHSA-mjcw-gfh6-3cxm).v27.1.1Compare Source
t()skips the interpolation and nesting regexp scans when the text has no interpolation or nesting prefix, about 6-14% faster for short texts and up to 75% for long ones. The output does not change. Thanks @g4lb (#2469)v27.1.0Compare Source
countis missing,t()uses the_otherform of the same language before the next fallback language, as CLDR does (lateral inheritance), instead of returning the key. Current CLDR data gives French, Spanish, Italian and Portuguese amanyform for exact millions, so files with only_oneand_othershowed the key (or the fallback language) forcount: 1000000. The plain key still comes first, sokey+key_otherkeeps resolvingkey; with a context,key_<context>_othercomes beforekey_other; ordinals use_ordinal_other; anddefaultValue_otheris used afterdefaultValue. A form filled in from_otheris no longer reported as missing (saveMissing,missingKeyHandler,exists()). Thanks @TenPotatoes (#2468)v27.0.1Compare Source
cacheInBuiltFormats: true, and formats added withaddCached. The cache key holds allt()options, including the interpolated values, so every new amount, date or name added a formatter that was never released: about 50 MB per 100k values, growing without end in a long-running server. A dropped formatter is made again from the same language and options, so the output does not change. Thanks @liustack (#2467).v27.0.0Compare Source
This is a major breaking release. It changes defaults that most setups had to override, gives every instance its own logger and post-processors, refuses language codes that look like markup or paths, and removes options that were broken or had no effect. 26.7 warned in debug mode about most of the runtime changes. The migration guide has the details; to keep the v26 behavior where an option exists:
Changed defaults
fallbackLngdefaults tofalseinstead of['dev']. Without afallbackLng, i18next no longer requestsdevfrom the backend (/locales/dev/translation.jsonwith i18next-http-backend), andsaveMissingsends missing keys for the current language instead ofdev. WithsupportedLngsand nofallbackLng, an unsupported language leaveslanguageandlanguagesunset, asfallbackLng: falsealready did. SetfallbackLngto your main language, or to'dev'for the previous behavior.returnEmptyStringdefaults tofalse: an empty translation falls back like a missing value (to the fallback language, the default value or the key), asnullalready does. i18next-cli writes''for untranslated keys in the other languages, which now fall back instead of rendering blank. An explicit''default from code still counts:t('key', '')andt('key', { defaultValue: '' })return''. SetreturnEmptyString: true(ininit()and inCustomTypeOptions) if an empty translation is meant to render nothing, for example for a Locize project with "preserve empty strings" on.'EN'becomes'en'. Only the casing changes: aliases liketl,iworengstay as they are ('TL'becomes'tl'), and so do codes that are not BCP 47 (en_US,my_custom). i18next 26.7.0 and 26.7.1 warned that v27 turnsiwintoheortlintofil; that was wrong and 26.7.2 corrects it.iw,tland the like stay as they are. SetcleanCode: falseto keep codes without a region exactly as they are.cleanCodeis deprecated.strictInterpolationChecksdefaults totrue:t()needs the options for a string with variables, so a{{name}}cannot be left out of a call. Type a wrapper aroundt()withParseKeysWithoutVariables, declare the variablesinterpolation.defaultVariablesfills in withdefaultVariablesinCustomTypeOptions, or setstrictInterpolationChecks: falseto keep the v26 types (also for ICU and MF2 messages, whose arguments are required either way). The fixes below close the gap plural keys left.returnEmptyStringdefaults tofalseinTypeOptionstoo, so a key whose value is''is typed as the key.Changed behavior
use()of a logger or a post-processor on one instance no longer changes the others, and theinit()of one instance no longer rewires the logging of all of them. An instance fromcreateInstance()does not see what the defaulti18nextinstance (or any other) registered: calluse()on each instance. A clone (cloneInstance()) keeps its parent's logger and post-processors, also those its parent registers later, and what it registers itself stays its own. A plugin that callsuse()from its owninit()(the Locize InContext editor) registers right away, as before.services.loggerstays the instance's logger, withforward(). In debug mode, apostProcessname that is not registered on the instance logs a warning.returnObjectsis handled like a missing key:t()returns the default value if one is passed, else the key (withappendNamespaceToMissingKey,parseMissingKeyHandlerand the post-processors applied), instead of the sentencekey '... (en)' returned an object instead of string., which ended up in the UI. It is not saved as missing, since the key exists. The debug warning stays, andreturnedObjectHandlerstill decides what is returned when it is set (returnedObjectHandler: (key) => `key '${key}' returned an object instead of string.`brings a sentence back).addResources()keeps every value: numbers, booleans and objects were dropped silently, only strings and arrays were added./:'$10/month'stays'$10/month'instead of'$10/month', and dates in react-i18next'sTransno longer render as17/12/2025(discussion 2199).&,<,>,"and'are still escaped, which covers HTML text and quoted attributes; a/cannot end either. Update snapshots that contain/, or pass your owninterpolation.escapeto keep escaping it.lng,changeLanguage(), a language detector orloadLanguages()that does not have the shape ofisSafeLanguageCode()(letters, digits,-,_,@and., no.., at most 128 characters) is refused unless it is configured: listed insupportedLngs, in afallbackLngthat is not a function or inpreload, or a language inresources, as given toinit().changeLanguage()continues as with an unsupported code: with the detector's next code, else the fallback language, else none (withfallbackLng: false, a code refused atinit()leaveslanguageunset);loadLanguages()skips it. WithsupportedLngs, the input is matched as before ('de-DE;q=0.9'still gives'de'), and only an unsafe match is refused, which onlynonExplicitSupportedLngscan return ('de-<x>'for a supported'de'). WithoutsupportedLngs, a detector that returned"><img src=x onerror=alert(1)>made that stringi18next.language, which apps put into<html lang>, and backends were asked to load it. BCP 47, POSIX (en_US.UTF-8@euro,sr@latin) and private-use codes (en-x-pirate) pass; to use a code with other characters (+, spaces,/), list it insupportedLngs. In debug mode a refused code logs a warning.createInstance(options)merges the defaults right away, without initializing: beforeinit(),instance.optionshas the defaults,getFixedT()no longer throws (t()returns''untilinit()), anddebug: truealready shows the warnings beforeinit().init()still tells the options you set from the defaults, so akeySeparatorornsSeparatorpassed tocreateInstance()counts as set by you (#2426).loadNamespaces()beforeinit()does nothing and calls back, as it did for an instance without options.keySeparator: falsemeans flat keys only: a lookup no longer splits a key at the textfalse(t('nestedfalsec')returned the value ofnested.c), and a selector path is joined with.like a key prefix, so selectors work on the flat keys ($ => $['a.b']and$ => $.a.blook up the flat key'a.b';$ => $.nested.cno longer resolvesnested, thenc). types: withkeySeparator: falseinCustomTypeOptions, the keys are the flat keys (nonestedfalseckeys), a key containingfalseis no longer split, andkeyPrefixtakes the parts of the flat keys before a., which is howgetFixedT()joins it ('nested'for'nested.c'). A key prefix combined with selectors is not typed for flat keys.Removed
getResource('en.translation.key'),addResource('en.translation.key', value)andaddResourceBundle('en.translation', resources). Pass language, namespace and key as separate arguments;addResource(),addResources()andaddResourceBundle()throw aTypeErrorfor the dotted form. A language code with a.(de_DE.UTF-8) is now a language like any other.interpolation.prefixEscaped,suffixEscaped,nestingPrefixEscapedandnestingSuffixEscaped, which were inserted into the RegExp unescaped. Pass the literal delimiters asprefix,suffix,nestingPrefixandnestingSuffix.compatibilityJSON(it had no effect since v24).locizeLastUsedis declared by locize-lastused (5.1.0 and later).ReactOptionsstays importable from'i18next'but is empty: react-i18next fills it in (17.1.13 and later, and 18), so thereactoptions are checked when react-i18next is in the program._and$helpers intypescript/t.d.tsandtypescript/options.d.ts($FirstNamespace,_ValueOfand 84 more) are no longer importable; every declaration of those files counted as exported. The other types of those files (TOptionsBase,TFunctionSignature,ParseTReturn, ...) are now exported on purpose. If you imported one of the hidden helpers, please open an issue: exporting it again does not break anything.index.js, a CommonJS shim that theexportsmap made unreachable.Support
engines); CI tests 22, 24 and 26.defaults, which moved with every update of the browser data. The output is the same as 26.7's.^5 || ^6 || ^7, unchanged.Kept
callbackApistill work; i18next guesses their calling convention from the number of parameters and logs a deprecation warning in debug mode.isInitialized,initializedStoreOnceandinitializedLanguageOncestay writable, so react-i18next 17'suseSSRand next-i18next's Pages Router work with 27. Writing them is deprecated: callhydrate().services.backendConnector.backendstays readable.Type fixes for
strictInterpolationChecksstrictInterpolationChecks, a plural key no longer switches the check off. Withoutcounta plural key likeitem(item_one,item_other) has no value of its own, and thestringit resolved to hid the variables of every other key in a union:(key: 'greeting' | 'item') => t(key)and(key: ParseKeys<'ns'>) => t(key)compiled as soon as the namespace had a plural key, while the same wrapper without one failed. Now such a call is checked against the plural forms, ordinal ones and'ns:item'keys included:t('item')needscountwhen the forms use it, and a wrapper over a union with a plural key fails as it does without one. To migrate, passcount, or type the wrapper withParseKeysWithoutVariables.strictInterpolationChecks, a call with options needs the variables of a plural key's forms too:t('item', { defaultValue: 'x' })and(key: 'plain' | 'item') => t(key, { defaultValue: 'x' })needcountwhen the forms use it, ast('item')does. Before, any options object turned the check off for a plural key withoutcount. Without the flag the options types are unchanged.ParseKeysWithoutVariablesleaves out a key whose ordinal forms takecount, and keeps a key that has its own value next to its plural forms, sincet()returns that value withoutcount.t('ns:item')for a plural key withoutcountreturnsstring, ast('item')does, instead ofnever.Configuration
📅 Schedule: (UTC)
🚦 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.