yarn i18next 27.2.0
v27.2.0

latest release: 27.2.1
51 minutes ago
  • fix: an error thrown by a load callback or a listener (the callback of init, changeLanguage, loadNamespaces or loadLanguages, or a languageChanged / loaded listener) is no longer handed back to the backend connector as if the read had failed. With a backend whose read returns a value or a promise, the connector got that error a second time: the namespace that had loaded was marked as failed, failedLoading was 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 a read that returns a value, and it is an unhandled rejection for a read that returns a promise, which ends a Node.js process unless you handle unhandledRejection. Thanks @SudeepGowda55 (#2477)
  • fix: when a load callback throws, the other callbacks waiting for the same namespaces are still called and the loaded event is still emitted, and the error is thrown on after that. A second loadNamespaces() for the same namespace never called back before.
  • fix: 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 threw Cannot create property ... on number, also without overwrite. With overwrite, a number, boolean or null now also replaces a nested object, as a string already did. Thanks @SudeepGowda55 (#2476)
  • fix: with 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)

Don't miss a new i18next release

NewReleases is sending notifications on new releases.