i18next v26.5.7

v26.5.7
Changed 1
  • When the cache key cannot be built, the value is formatted without the cache, as with cacheInBuiltFormats set to false, including formatters added with addCached.
Fixed 1
  • With the default cacheInBuiltFormats setting, built-in formats now work when t() options contain a BigInt or a circular object, instead of returning the raw value.

From i18next

  • fix: with the default cacheInBuiltFormats: true, built-in formats now also work when the t() options contain a BigInt or a circular object. The cache key was built with JSON.stringify over all options, including the interpolation values, which throws on those, so every built-in format in that call returned the raw value: t('num', { val: 12345678901234567890n }) with 'Total: {{val, number}}' returned 'Total: 12345678901234567890' instead of 'Total: 12,345,678,901,234,567,890', and passing an object with a back-reference (like an ORM entity) left all numbers, dates and lists of that call unformatted. When the key cannot be built, the value is now formatted without the cache, as with cacheInBuiltFormats: false. This also applies to formatters added with addCached. Other calls still use the cache as before. Thanks @nk-batman21 (#2457).
View original

Upgraded? How did it go?

Discussion