Open hanayashiki opened 3 years ago
In some context, it is necessary for us to localize not only strings but also components/JSX
let Strings = new LocalizedStrings({ en: { "pay": ( <Paypal /> ), "link": ( ({ name }) => ( <a>{name}</a> ) ) }, cn: { "pay": ( <Alipay /> ), "link": ( ({ name }) => ( <a><img alt={name} src="..." /></a> ) ) }, });
To use them:
return ( <div> {Strings.pay} <Strings.link name={"114514"} /> </div> );
Basically we might want to localize any type
It seems it is currently supported, but not listed in the documentation
In some context, it is necessary for us to localize not only strings but also components/JSX
To use them: