- Fix syntax error in react types when generating an empty project
- Throw Error in
useIntl
when context is not initialized - Add a Data-Oriented API, and expose a
TranslationKey
type that can be used in user code.
- Don’t throw on invalid language tags
- Support a
fallbackLocale
option that avoids generating thetemplate
locale.
- See the introductory blog post for an overview of features and the docs for an overview of the API.
- Update deprecated
React.SFC
usage
- Add special
currency
,currency0
,currencycode
andcurrencycode0
formats for thenumber
type. These are implemented in a special way and expect a{ currency: string, value: number }
object as argument. No typechecking however :-(
- Massively improved error messages when encountering invalid / unsupported syntax
- Add a
WithIntl
type to accompany thewithIntl
HOC
- Improve codegen a bit, and allow camelCase Ids on
<Localized />
Component.
- Also expose dashed Ids on the
Intl
object:intl["my-dashed-id"]()
- Export all the message Ids as
Ids
typescript type - Provide a
withIntl
HOC
- Gracefully handle wrong usage of generated React Components.
- Warn at compile time about missing translations. It will now fall back to the
messages defined in the
defaultLocale
if any other locale does not have those messages defined.
- Simple plurals, with
=X
andother
selectors are now supported.
IntlCodegen
constructor now takes an optionalOptions
object, which can take custom formats.- Generated code now includes a
locales
export, which is a list of all defined locales. This is also exposed asloadLanguage.locales
. - In a similar way, the loaded locales now have a
locale: string
prop. IntlCodegen
will warn if you define a message that conflicts with any reserved key, such as thelocale
prop mentioned above.- You can now use the
number
,date
andtime
formats.