Update dependency i18next to v26 #554
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/i18next-26.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^25.3.2→^26.0.0Release Notes
i18next/i18next (i18next)
v26.0.8Compare Source
ExistsFunctionshape so plain arrow functions can again be assigned toExistsFunction-typed variables (TypeScript cannot infer type predicates through multi-overload assignment). Directi18next.exists(key)calls still narrowkeytoSelectorKey— the predicate is now declared inline oni18n.exists. Custom wrappers that want the narrowing can type themselves astypeof i18next.exists2425v26.0.7Compare Source
missingKeydebug log now shows the actual plural-resolved key (e.g.foo.bar_manyfor Polishcount: 14) instead of the base key — making it obvious which plural category was expected and missing 2423@babel/runtimeruntime dependency. The build no longer generates any@babel/runtimeimports, so the package is unused by consumers. Rollup now usesbabelHelpers: 'bundled'so any helpers that are ever needed in the future will be inlined rather than imported externally 2424dist/esm/i18next.bundled.js. It was byte-identical todist/esm/i18next.jsbecause no helpers were being imported 2424v26.0.6Compare Source
Security release — all issues found via an internal audit.
escapeValue: falsewith interpolated variables inside a$t(key, { ... "{{var}}" ... })nesting-options block. In that narrow combination, attacker-controlled string values containing"can break out of the JSON options literal and inject additional nesting options (e.g. redirectlng/ns). The defaultescapeValue: trueconfiguration is unaffected because HTML-escaping neutralises the quote beforeJSON.parse. See the security note in the Nesting docs for the full pattern and mitigationsregexEscapetounescapePrefix/unescapeSuffixon par with the other interpolation delimiters. Prevents ReDoS (catastrophic-backtracking) when a misconfigured delimiter contains regex metacharacters, and fixes silent breakage of the{{- var}}syntax when the delimiter contains characters like(,[,..env*and*.pem/*.keyfiles in.gitignorev26.0.5Compare Source
cloneInstance().changeLanguage()no longer fails to update language state when the target language is not yet loaded — a race betweeninit()'s deferredload()and the user'schangeLanguage()could overwriteisLanguageChangingTo, causingsetLngPropsto be skipped 2422v26.0.4Compare Source
{{price, currency(EUR)}}are now correctly resolved to their base format type (e.g.numberforcurrency) instead of falling back tostring2378v26.0.3Compare Source
addResourceBundlenow accepts an optional 6thoptionsparameter ({ silent?: boolean; skipCopy?: boolean }) matching the runtime API 2419v26.0.2Compare Source
t("key", {} as TOptions)no longer produces a type error — the context constraint now bypasses strict checking whencontextisunknown(e.g. fromTOptions) 2418v26.0.1Compare Source
alwaysFormatistrueand no format specifier is present (formatisundefined)undefined/nullvalues as-is instead of producingNaNwhen the value is missingv26.0.0Compare Source
This is a major breaking release:
Breaking Changes
initImmediateoption — the backward-compatibility mapping frominitImmediatetoinitAsync(introduced in v24) has been removed. UseinitAsyncinstead.interpolation.formatfunction — the old monolithic format function (interpolation: { format: (value, format, lng) => ... }) is no longer supported. The built-in Formatter (or a custom Formatter module via.use()) is now always used. Migrate to the new formatting approach usingi18next.services.formatter.add()or.addCached()for custom formatters.showSupportNoticeoption and all related internal suppression logic (globalThis.__i18next_supportNoticeShown,I18NEXT_NO_SUPPORT_NOTICEenv var). See our blog post for the full story.simplifyPluralSuffixoption — this option was unused by the core PluralResolver (which relies entirely onIntl.PluralRules). It only had an effect in the old v1/v2/v3 compatibility layer. The v4 test compatibility layer now defaults totrueinternally.@babel/polyfillfrom devDependencies.Improvements
indexOf() > -1/indexOf() < 0with.includes()(~40+ occurrences)indexOf() === 0with.startsWith()where appropriatevarwithconst,'' + objectwithString(object),.substring()with.slice().apply(observer, [event, ...args])with direct callobserver(event, ...args).call(this, ...)in BackendConnector retry logicarray-callback-returnin LanguageUtilsgetBestMatchFromCodeseslint-disablecomments from source filesonce()method for one-time event subscriptionscheckedLoadedForcache to Translator instance, preventing cross-instance state leakageBackendModulegeneric parameter naming inconsistency between CJS and ESM type definitionsonce()method toi18nandResourceStoretype interfacestest.projectsconfigConfiguration
📅 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 has been generated by Mend Renovate.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.