Closed Swatinem closed 5 years ago
I implemented something that is similar to this proposal from fluent: https://github.com/projectfluent/fluent/issues/140
typing for messageformat based definitions is done manually.
currently has support for string
, number
, datetime
, monetary
and element
.
element
is a special case, which accepts React.ReactNode
as param, and switches any localization string that has a element
param to return Array<React.ReactNode>
instead of string
.
Currently,
intl-codegen
just collects all the used variables inside the translations to generate some type hints.The goal here is:
<Localized />
select
number
date
/time
currency
type (#14)ReactNode
(#15)The way our usage of
intl-codegen
has changes shows me that it might be a good idea to define some kind ofschema
that defines: