npm i18next 27.2.2
v27.2.2

one hour ago
  • fix: setDefaultNamespace() works on a clone. A clone's translator keeps its own options object, so the call changed i18n.options.defaultNS while t() kept using the old default namespace. i18next-http-middleware hands every request a clone, so req.i18n.setDefaultNamespace() did nothing there. (#2106)
  • fix: supportedLngs works in any casing. Every other language code is formatted (pt-br to pt-BR, EN to en, all lowercase with lowerCaseLng), but supportedLngs was compared as written, so supportedLngs: ['pt-br'], ['EN'], or ['pt-BR'] with lowerCaseLng: true refused that language and fell back. They are now compared in that formatted form (also by loadLanguages()), while options.supportedLngs stays as written. (#1791)
  • fix(types): resources typed with named 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, so t('nested.key') failed with TS2345 while t('nested') compiled. Interfaces now give the same keys as type aliases, so t('nested') without returnObjects is rejected for them too. (#2326)
  • fix(types): typed keys work with strictNullChecks: false. Without strict null checks undefined passes extends string, so the key prefix, namespace and context checks took a missing keyPrefix, ns or context for a value: t('title') was rejected (only t('ns:title') compiled), t() returned string, and react-i18next's Trans accepted no i18nKey. A new type test project compiles with strictNullChecks: false; with strict null checks the types resolve as before. (#2085)

Don't miss a new i18next release

NewReleases is sending notifications on new releases.