mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-08 23:21:00 +00:00
add key to IntlProvider so it rerenders on locale change
This commit is contained in:
parent
285b37f825
commit
571af4527f
@ -7,6 +7,8 @@ import type { State } from 'flowtype';
|
||||
|
||||
import { IntlProvider, addLocaleData } from 'react-intl';
|
||||
|
||||
// import { LANGUAGE } from 'config/variables';
|
||||
|
||||
import en from 'react-intl/locale-data/en';
|
||||
import cs from 'react-intl/locale-data/cs';
|
||||
import bn from 'react-intl/locale-data/bn';
|
||||
@ -62,10 +64,13 @@ const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: St
|
||||
|
||||
|
||||
const ReactIntlProvider = ({ children, locale }: Props) => {
|
||||
// const localeData = await import(`react-intl/locale-data/${locale}`);
|
||||
// addLocaleData(localeData);
|
||||
const localeMessages = messages[locale];
|
||||
console.log(locale);
|
||||
return (
|
||||
<IntlProvider
|
||||
key={locale}
|
||||
locale={locale}
|
||||
messages={localeMessages}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user