1
0
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:
slowbackspace 2019-02-14 15:51:59 +01:00
parent 285b37f825
commit 571af4527f

View File

@ -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}
>