mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-09 15:40:55 +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 { IntlProvider, addLocaleData } from 'react-intl';
|
||||||
|
|
||||||
|
// import { LANGUAGE } from 'config/variables';
|
||||||
|
|
||||||
import en from 'react-intl/locale-data/en';
|
import en from 'react-intl/locale-data/en';
|
||||||
import cs from 'react-intl/locale-data/cs';
|
import cs from 'react-intl/locale-data/cs';
|
||||||
import bn from 'react-intl/locale-data/bn';
|
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 ReactIntlProvider = ({ children, locale }: Props) => {
|
||||||
|
// const localeData = await import(`react-intl/locale-data/${locale}`);
|
||||||
|
// addLocaleData(localeData);
|
||||||
const localeMessages = messages[locale];
|
const localeMessages = messages[locale];
|
||||||
console.log(locale);
|
console.log(locale);
|
||||||
return (
|
return (
|
||||||
<IntlProvider
|
<IntlProvider
|
||||||
|
key={locale}
|
||||||
locale={locale}
|
locale={locale}
|
||||||
messages={localeMessages}
|
messages={localeMessages}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user