All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- [Added] Add
utc?: boolean
as an optional parameter toI18n#localize
. This makes dates be rendered usinggetUTC*
functions instead.
- [Removed] Remove
I18n#availableLocales
, as it's no used anywhere. - [Changed]
I18n.t
now replaces all instances of a placeholder in a translation.
- [Changed] Revert exports change back, as it has caused way too much friction.
- [Fixed] Add imports for react-native.
- [Fixed] Reference full file path as the types import.
- [Fixed]
I18n#formatNumber
now formats numbers with default options, conforming to the API described on the readme file. - [Fixed] Fix entrypoints, making them point the correct files.
- [Fixed] Changed translations lookup to support keys containing dots (
.
) when using custom separators. - [Changed] Updated
I18n#update
andI18n#store
to support translations that use custom separators and dots (.
).
- [Changed] Move esbuild dependency to development instead.
- [Fix] Storing translations that contain numeric keys now work properly; previously it was creating arrays instead of objects.
- [Changed] Stop using lodash's
isArray
in favor ofArray.isArray
. - [Fix] Lodash's
snakeCase
import. - [Fix] Bring back
webpack
so we can build browser distribution. - [Removed] Vendored lodash typings.
- [Changed] Revert lodash vendoring.
- [Changed] Vendor lodash, so it's easier to use i18n-js with importmaps.
- [Added] Introduce
useMakePlural(options)
function as way of creating pluralizers on top of make-plural. - [Changed] Use
make-plural
'sen
function as the default pluralizer. - [Changed] Mark
Scope
type as read-only.
- [Changed] Import lodash modules directly, which reduces final exported size by 36% (#41).
- [Changed] The
I18n#translate
's return type is now a string and generics union. - [Fixed] Fix issue when pluralization missed a key required by the pluralizer raised an error rather thanr returning the missing translation message (#39)
- [Changed] Interpolate strings when
i18n.t(..args)
returns an array. - [Fixed] Import cycle issue on
src/helpers/formatNumber.ts
. - [Added]
I18n#formatNumber
is now available as aI18n
instance method.
- [Changed] Removed
@internal
annotation from functions, so TypeScript can export types properly. - [Changed] Export additional types from main file.
- [Added]
I18n#onChange
now returns a function that removes the handler from events. - [Added]
I18n#interpolate
is now available on the instance ofI18n
and can therefore be overridden.
- Official release of i18n-js v4.0.0.