npm / i18next
i18next
What changed in i18next 20 to 27, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-04.
86 breaking4 security14 deprecations31 new APIs and options7 performance19 behavior and defaults4 tooling69 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initi18next 2743 changes
Breaking changes 27
With
overwrite, numbers and booleans are replaced too, and numbers, booleans, or null can replace a nested object.Errors thrown by load callbacks or listeners now reach the app instead of being handed to the backend connector as failed reads.
When the selected plural form is missing, t() uses the same language’s _other form before trying the next fallback language; forms filled from _other are no longer reported as missing.
Plural forms filled in from _other are no longer reported as missing by saveMissing, missingKeyHandler, or exists().
The dotted language resource-store call form is removed; pass language, namespace, and key as separate arguments.
The dotted language-and-namespace form is removed; pass language and namespace separately. The dotted form throws a TypeError.
Language codes without a region now get canonical casing, so 'EN' becomes 'en'. Set cleanCode to false to preserve their original casing.
Removed from the types because it had no effect since v24.
Options are merged into defaults immediately without initializing the instance; pre-init options are available, getFixedT no longer throws, and t() returns '' until init().
In v27, fallbackLng defaults to false instead of using the implicit 'dev' fallback; set the source language explicitly.
The dotted-key form is removed; pass language, namespace, and key as separate arguments.
The root CommonJS shim is removed because the exports map made it unreachable.
The default escaping no longer escapes '/'; &, <, >, double quote, and apostrophe remain escaped.
Removed; use literal delimiters through nestingPrefix instead.
Removed; use literal delimiters through nestingSuffix instead.
Removed; use literal delimiters through prefix instead.
Removed; use literal delimiters through suffix instead.
With keySeparator: false, lookups use flat keys without splitting at false, selector paths join with dots, and types reflect flat keys and prefixes.
Logger state is now per instance rather than shared; an instance created with createInstance does not inherit the default instance's registrations.
The minimum supported version is Node.js 22.
Plugin option types are no longer provided; locizeLastUsed is declared by locize-lastused, and react options are checked when react-i18next is in the program.
Post-processors are now per instance. Register them on each instance; clones keep their parent's processors, including later registrations.
Remains importable from i18next but is empty; react-i18next fills it in so react options are checked when react-i18next is in the program.
In v27, returnEmptyString defaults to false, so an empty string falls back like a missing key.
Without returnObjects, an object or array translation is handled like a missing key and t() returns the default value or key; returnedObjectHandler still controls the result when set.
Defaults to true for typed resources, requiring t() calls to provide interpolation variables; set it to false to keep the v26 types.
Plural keys no longer disable variable checks in calls or wrappers, including calls with options; plural and ordinal forms are checked for required count values.
Deprecations 1
The option for preserving casing of language codes without a region is deprecated.
Performance 3
Only the most recent 1000 failed loads are kept; an older failed load is read again when needed, preventing unbounded memory growth.
t() skips interpolation and nesting regexp scans when the text has no interpolation or nesting prefix, improving performance without changing output.
Each cached format keeps at most 1000 formatters, dropping the oldest when full, preventing unbounded memory growth without changing output.
Behavior and default changes 2
When a load callback throws, other callbacks waiting for the same namespaces still run and the
loadedevent is emitted before the error is thrown.In debug mode, an unregistered post-process name on the instance logs a warning.
Fixes and other changes 10
A variable passed as undefined now renders as an empty string in a formatted placeholder, matching the behavior of an unformatted placeholder.
With
keySeparator: false, a namespace separator inside the key after the namespace is kept, allowing flat keys such aserrors:requiredto be looked up correctly.once() listeners are removed before they run, so off() can remove them and reentrant events or exceptions do not cause them to run more than once.
Selector results for JSON arrays that mix arrays with objects or strings keep the inner arrays as arrays.
With enableSelector, assigning a t function to a wider TFunction type no longer fails with TS2590 when namespaces have about 600 top-level keys.
With an object fallbackLng, language codes matching Object.prototype properties now get the default fallback instead of causing fallbackCodes.forEach to throw.
Language codes matching inherited object properties now load like any other unknown language, preventing a backend load from throwing and terminating a Node.js server process.
Now keeps every value, including numbers, booleans, and nested objects, instead of silently dropping values other than strings and arrays.
Excludes keys whose ordinal forms require count, while retaining keys that have their own value alongside plural forms.
A namespaced plural key without count now returns string rather than never, matching the behavior of t('item').
i18next 26125 changes
Breaking changes 43
Without languages, reloads current languages and every language the backend loaded or tried to load, including for clones, and retries bundles that failed to load.
Hydrates resources rendered on the server into the store and changes to the server's language, each only the first time.
Setting nsSeparator to false now also removes the ns:key form from TypeScript key types.
Without languages, reloadResources now reloads nothing instead of throwing; backends that reload preload must pass its languages.
Lets a backend reload its bundles through i18next, with retries and the loaded event, instead of calling backend connector methods itself.
Calling t() before init() now returns an empty string, as typed, instead of undefined.
An array of selectors with a plural member now requires count, matching runtime behavior that skips the plural member when count is absent.
An array of selectors with defaultValue now returns the literal values and default value as a union instead of string.
Selector typing with
enableSelector: trueor'strict'avoids repeatedly filtering whole namespaces, reducing TypeScript type instantiations; selected values are unchanged, with noted changes to error display and null-only object typing.Nested false, 0, or '' values are returned instead of falling through to a flat key with the same dotted name; the same fix applies to t.
Language matching no longer selects a supported code merely because it starts with the detected language code; add two-letter codes to supportedLngs or map them with fallbackLng if needed.
Nested interpolation and translation lookups no longer resolve inherited prototype methods or walk through __proto__; these keys are treated as missing, allowing fallback and missing-key handling to apply.
With forkResourceStore: true, clones now copy resources at every level, so nested keys and arrays are isolated from the original and other forks.
With the default true value, placeholders inside values inserted with unescaped interpolation now stay literal, preventing them from pulling another variable from the same t() call into the output. Set it to false to restore the old behavior.
With the default true setting, a placeholder inside an interpolated value stays literal even when the same placeholder appears later in the translation. Results with false are unchanged.
With the selector API, plural keys now require count in the type checker when calls pass an explicit ns, matching runtime lookup behavior.
nest() resolves $t(...) in a single pass, so text kept literal by skipOnVariables is no longer resolved by an outer loop; this also avoids quadratic work on unclosed input.
The package no longer emits this file because it was byte-identical to dist/esm/i18next.js.
The Formatter returns undefined and null values as-is instead of producing NaN when the value is missing.
The dotted-key form is removed; pass language, namespace, key, and value separately. The dotted form throws a TypeError.
v27 canonicalizes codes without a region, changing 'EN' to 'en'.
Clones no longer inherit preload by default, avoiding redundant loading across preloaded languages and namespaces. Passing preload to cloneInstance() retains the old behavior.
Removed from options and CustomTypeOptions; it had no effect since v24.
Without a language, dir() now returns 'ltr' instead of 'rtl'.
The build targets ES2020, with the listed minimum browser versions.
The global suppression state for the console support notice is removed.
The environment variable for suppressing the console support notice is removed.
Custom formatters can be registered through the formatter service as part of the new formatting approach.
The unreachable CommonJS shim at the package root is removed; use require('i18next').
The deprecated compatibility mapping from initImmediate to initAsync is removed; use initAsync instead.
The deprecated option has been removed; use
initAsyncinstead.The 86 internal helpers whose names start with _ or $ are no longer importable; other types in the declarations remain exported.
The legacy monolithic format function is no longer supported; use the built-in Formatter or a custom Formatter module.
The legacy custom formatting function is no longer supported; migrate custom formatting logic to the Formatter API.
Unsafe language codes from language inputs are refused unless configured in supportedLngs, a non-function fallbackLng, preload, or init resources.
The best match no longer selects a supported language code merely because it starts with the same letters.
The option type is no longer declared by i18next; it is declared by locize-lastused 5.1.0 and later.
A nested 0, false, or empty string wins over a flat dotted key; a nested null falls back to it.
Objects and arrays without returnObjects are handled like missing keys; returnedObjectHandler still controls the returned value when set.
The types treat an empty-string translation as the key when returnEmptyString is false.
The option for controlling the console support notice is removed along with the notice.
The option for showing the console support notice has been removed.
The unused option is removed; the v4 test compatibility layer now defaults to true internally.
Security 4
Warns when escapeValue: false is combined with interpolated variables inside a $t nesting-options block, where quotes in attacker-controlled values can inject additional nesting options.
Strips CR, LF, NUL, and other C0/C1 control characters from string log arguments to prevent log forging through user-controlled values.
Regex-escapes the delimiter to prevent ReDoS from regex metacharacters and avoid breaking the
{{- var}}syntax.Exports a language-code safety check for plugins accepting a language from a request, URL, or storage.
Deprecations 13
Marked deprecated because it has had no effect since v24; it is slated for removal from the types in v27.
Dotted language forms of resource-store calls warn in debug mode and are slated for removal in v27; pass language, namespace, and key separately.
In debug mode, values containing / under the default escape warn that v27 will no longer escape /.
When fallbackLng is unset, requesting the default fallback language dev logs a debug notice; v27 is planned to default fallbackLng to false.
prefixEscaped, suffixEscaped, nestingPrefixEscaped, and nestingSuffixEscaped warn in debug mode and are slated for removal in v27; use the literal delimiters as the unescaped options.
Debug mode warns once per code when an unconfigured language from lng, changeLanguage(), or the detector fails isSafeLanguageCode; v27 is planned to refuse such codes.
Debug mode warns for regionless language codes that v27 will canonicalize differently; cleanCode: true already lower-cases them.
Debug mode warns when init() replaces a logger registered by another instance with use(); v27 will make loggers per instance.
Debug mode warns when an instance runs a post-processor registered only on another instance; v27 will make post-processors per instance.
In debug mode, an object or array hit without returnObjects warns that v27 will return the key instead of the sentence describing the object hit.
Guessing a backend or async detector's calling convention from its parameter count is deprecated and warns in debug mode when unmarked.
With debug enabled in v26.7.0, i18next logs warnings wherever a setup relies on something that changes in v27.
Writing this property from outside still works but is deprecated.
New APIs and options 20
Lets types recognize a custom interpolation.formatSeparator when parsing interpolation formats.
Exports a type for keys accepted by t() without options, excluding strings with variables and plural keys whose forms take count.
Exported intentionally as a public type.
Reload resources through the backend with retries and emit
loaded; without arguments, reload everything i18next loaded or tried to load through the backend, including for clones.Add this type option to require
t()options for strings with{{variables}}, preventing raw interpolation placeholders from reaching the UI.With this option true, non-string values in unescaped placeholders or with escapeValue false are converted to strings instead of throwing.
Overrides the inferred type for an ICU format or MF2 function name, including custom functions.
Opting into ICU or MF2 parsing types t() options from message arguments, reporting missing, misspelled, and wrongly typed arguments, including when options are omitted.
Adds a mergeable augmentation surface for namespace resource types, allowing packages to contribute namespaces independently; same-key, different-literal conflicts are dropped to avoid poisoning t() overload resolution.
Exposes enableSelector on InitOptions so selector settings typecheck without a module augmentation; accepts false, true, 'optimize', or 'strict'.
Adds a CustomTypeOptions flag, defaulting to true, to disable type-level parsing of translation strings for {{variable}} patterns; runtime interpolation is unaffected.
Opt-in strict mode exposes every namespace only under its own key on $, and rewrites a leading selector path segment matching the scope's namespace list as a namespace prefix, including the primary.
A fourth optional fixedOpts argument carries scopeNs so selector paths with a namespace prefix route correctly under useTranslation([nsA, nsB]), without changing the bound resolution namespace.
The TypeScript signature now accepts an optional sixth options parameter, matching the runtime API.
Backends and async language detectors can declare whether they use callbacks or return a promise or value; this avoids relying on Function.length to guess.
Declares variables supplied at runtime by interpolation.defaultVariables; those variables become optional in t() options while retaining their types when passed.
SSR integrations should use hydrate() to put server-rendered resources into the store.
Custom formatters can be registered through the formatter service using the cached registration method.
EventEmitter adds one-time event subscriptions, and the method is also added to the i18n and ResourceStore type interfaces.
Plugin authors should use this API to reload resources instead of calling backendConnector.read() and loaded() themselves.
Performance 4
Type-checking the selector API with context is no longer quadratic in object size; context variants are collected in one pass, avoiding excessive type instantiation and out-of-memory failures.
Type-checking t() calls against large namespaces is no longer quadratic; cached key unions and direct literal-key lookups reduce check time without changing keys, return types, or errors.
Non-empty bundle checks are cached across instances, making later checks O(1). Bundles emptied manually with delete remain counted as having translations; use removeResourceBundle() instead.
Caches hierarchy resolution results per (code, fallbackCode) pair to reduce per-call cost. If other resolution-relevant options change at runtime, call i18next.services.languageUtils.clearCache(); dynamic fallbacks remain uncached.
Behavior and default changes 7
The deprecation warning for language codes without a region now appears only when casing changes; codes such as iw, tl, and eng are not treated as aliases.
With the default skipOnVariables: true, missing interpolation variables are now logged in debug mode once per string and variable.
strictInterpolationChecks will default to true from v27.
In debug mode, warns when a second backend, language detector, i18nFormat, or formatter replaces the first one.
Unformatted interpolation values are now typed as string | number; formatted values retain their precise types, and count remains number-only.
ReactOptions remains importable from i18next, while react-i18next supplies its body and enables checking of react options when included in the program.
With the default enabled, a {{placeholder}} inside a value inserted with {{- var}} stays literal.
Tooling 1
The per-call skipInterpolation option is now typed.
Fixes and other changes 33
Retries bundles that failed to load, allowing reloads and backend reloadInterval recovery to restore languages after a startup backend or network outage.
Without languages specified, reloads current languages and every language the backend loaded or tried to load for the instance and its clones, but never requests cimode.
A clone's services.utils is now bound to that clone, while the parent keeps its own, fixing saveMissing namespace checks across clones.
With nsSeparator: false in CustomTypeOptions, key unions no longer contain nsfalsekey-style keys, and keys containing false are no longer split at that text.
off('a b', listener) now removes the listener from both events, matching on('a b', listener).
Its type may return a value, matching runtime behavior where that value is what t() returns.
With
forkResourceStore: true, cloneInstance no longer mutates the options object it is given, preventing later clones from silently sharing the parent's resource store and avoiding errors with frozen options.With a disabled or custom separator, nested interpolation and defaultVariables values of 0, false, or '' are now inserted correctly; nested falsy values also take precedence over flat dotted keys.
Joined arrays now receive the same resolved details as strings, allowing post processors and i18nFormat plugins to access lookup metadata; nested arrays also stop at the recursion guard instead of overflowing the stack.
When the cache key cannot be built because options contain a BigInt or circular object, formatting now proceeds without the cache, including for formatters added with addCached.
On TypeScript 7, failed t calls with missing, misspelled or wrongly typed options again report the relevant option error, matching TypeScript 5 and 6.
With default non-strict key checks, missing or misspelled interpolation variables in an options object now report the missing variable instead of a misleading default-value overload error.
Loads the new namespace for the clone's language and fallbacks instead of every preloaded language.
Formatted fallback language codes already in the hierarchy are no longer added a second time, preventing duplicate language lookups while preserving order.
Checks the resolved language code actually loaded, or waits for the fallback when lng is outside supportedLngs, preventing readiness loops.
Nested values containing
$&,$,$'or$$` now stay literal, and non-string values returned by formatters in the nesting chain are stringified.The selector-form keyPrefix overload is now available when enableSelector is 'strict', preserving the returned t function's keyPrefix scope.
The optional TypeScript peer dependency range now allows TypeScript 7, avoiding an npm install peer conflict.
The returnDetails path no longer mutates the passed replace object; returned usedParams still includes count.
With skipOnVariables: true and escapeValue: true, placeholders inside interpolated values containing escapable characters now stay literal.
Multiline options objects in nested $t() calls are now parsed correctly, so nested lookups receive their options and resolve placeholders.
With deep merging and overwrite enabled, inherited built-in properties are now copied as plain own data instead of being recursed into, preventing shared built-ins from being corrupted.
Selector calls with context and returnObjects: true now preserve the full shape of heterogeneous JSON array elements instead of collapsing their types.
Parenthesised formatter options containing the format separator now work at any position in a chain, preventing inner commas from corrupting output.
Using keyPrefix no longer widens t()'s return type to include values from sibling keys in the namespace.
Restores the pre-v25.10.4 type shape so plain arrow functions can be assigned to ExistsFunction-typed variables; direct i18next.exists calls still narrow keys, and custom wrappers can use typeof i18next.exists for narrowing.
When a plural lookup misses, the debug log shows the plural-resolved key instead of the base key, making the missing plural category clear.
Calling changeLanguage() on a cloneInstance() now updates language state when the target language is not yet loaded, avoiding a race that could skip setLngProps.
Inline formatting options now resolve to their base format type, such as number for currency, instead of falling back to string.
t("key", {} as TOptions) no longer produces a type error when context is unknown, because the context constraint bypasses strict checking.
The Formatter no longer crashes when alwaysFormat is true and no format specifier is present.
The generic parameter naming inconsistency between CJS and ESM type definitions is fixed.
The cache moves from module scope to the Translator instance, preventing cross-instance state leakage.
i18next 2546 changes
Breaking changes 2
When a key resolves to plural forms, the selector API now enforces
{ count: number }.getCleanedCode now replaces all underscores.
New APIs and options 9
Exports a stable, readable helper type for typing selector function props.
The support notice check also checks the I18NEXT_NO_SUPPORT_NOTICE environment variable.
Allows custom formatters to be typed via CustomTypeOptions.
Supports selector syntax in getFixedT and per-call options.
The selector API now accepts an array of selector functions, analogous to an array of keys.
An option can suppress the support message.
Type definitions were added for the transDefaultProps option in react-i18next.
Exports the InterpolationMap type for use by developers.
Selector functions can be passed to t with enableSelector, while string keys remain first-class and the selector API stays opt-in; the previously announced v26 default and v27 deprecation plans are dropped.
Behavior and default changes 7
The support notice is suppressed automatically when NODE_ENV=production.
Selector functions used as keyPrefix now provide full type-safe key narrowing, scoping the returned t function to the prefix subtree.
The i18nKey prop accepts SelectorKey values, allowing selector keys to be used with Trans.
The selector callback is constrained against resource definitions to catch invalid keys at compile time; optional ns and keyPrefix options support non-default namespace and prefix contexts.
Returns a branded SelectorKey type that t() accepts directly, enabling pre-computed and reusable translation keys.
Always uses getBestMatchFromCodes for string or array language inputs.
Now tries to fall back to a language code with the same script.
Tooling 3
Type definitions now support TypeScript 6.
TypeScript 6 is supported, addressing the cited react-i18next issue.
Interpolation values are automatically typed from built-in format specifiers, such as number for
numberand Date fordatetime.
Fixes and other changes 25
Reordered overloads so Parameters<TFunction> resolves to the general selector signature instead of the branded SelectorKey type.
FilterKeys now excludes base keys with context variants when the provided context matches none of those variants.
In selector mode, preserves non-context, non-plural leaf keys when context is provided, fixing incorrect type narrowing with returnObjects: true.
String unions with invalid members are now correctly detected as type errors when used as the context option.
The selector now resolves namespaces against the effective ns rather than the global init options.
Fixes namespace resolution for a single-string ns and the primary namespace in an array; only paths starting with a secondary namespace in a multi-namespace array are rewritten.
The TypeScript return type is now this instead of void, enabling proper method chaining.
Fixes the Selector API so it can resolve namespaces.
Reverts the fix for compatibility with moduleResolution bundler.
Guards against null matchedDoubleQuotes while parsing the nesting option.
Escapes nestingOptionsSeparator during nesting option parsing.
Adds the missing toJSON declaration to the types.
Avoids a ReferenceError crash when the Intl API is unavailable.
The return value type definition for getFixedT() was corrected to address an incomplete type definition.
Fixes compatibility with moduleResolution set to bundler.
Fixes crashes when a backend in the backends array has no name property.
Fixes Namespace inference for the selector ns option.
Fixes the fallback for TFunctionReturn.
Fixes interpolation breaking when an instance is cloned.
Fixes invalid overwriting of the default value for overloadTranslationOptionHandler.
A wrong TypeScript signature was removed.
Creates a new interpolator when interpolation options are passed in, addressing issue 2371.
Fixes createInstance not existing on an instance.
For the largest resource sets, the documentation recommends using enableSelector: "optimize".
Fixes multiple changeLanguage calls that could produce results in the wrong order.
i18next 248 changes
Breaking changes 7
The initImmediate option is renamed to initAsync.
The Intl API is now mandatory, with no fallback.
Support for old i18next JSON formats is removed; existing v3 translations need conversion to v4 format.
Support for older environments is removed.
The language falls back to dev if a plural rule is not found.
TypeScript v4 support is removed.
Compatibility with the v1 API is removed.
Behavior and default changes 1
TypeScript v5 is now an optional peer dependency.
i18next 234 changes
Breaking changes 4
Support for old browsers was dropped.
Ordinal plural keys are now prefixed with _ordinal to help translators.
The default for returnNull changed to false.
The setDebug function in the logger was removed.
i18next 221 changes
Behavior and default changes 1
The translation function is now fully type-safe for TypeScript users.
i18next 216 changes
Breaking changes 3
This option is no longer used with the new v4 JSON format.
The default value is now true.
Deprecated whitelist features are removed.
New APIs and options 2
Adds the resolvedLanguage property to i18next.
Introduces a new JSON format with ICU plural forms and ordinal support.
Behavior and default changes 1
Natural language keys are detected automatically, so nsSeparator and keySeparator no longer need to be set to false.
i18next 201 changes
Fixes and other changes 1
PluginOptions can now be properly augmented, which matters when extending plugin option types.