aboutsummaryrefslogtreecommitdiffstats
path: root/src/I18n.tsx
diff options
context:
space:
mode:
authorLibravatar Ricardo Cino <ricardo@cino.io>2022-06-22 00:32:18 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-21 22:32:18 +0000
commit73ba955e344c8ccedd43235495ef8b72b5a2b6fd (patch)
tree03766ab32fefe7e83026a14393527f1dcbaed849 /src/I18n.tsx
parentdocs: add cino as a contributor for infra [skip ci] (#330) (diff)
downloadferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.tar.gz
ferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.tar.zst
ferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.zip
chore: Transform AppStore.js into Typescript (#329)
* turn actions into typescript * correct tsconfig * added TypedStore
Diffstat (limited to 'src/I18n.tsx')
-rw-r--r--src/I18n.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/I18n.tsx b/src/I18n.tsx
index 0e63d1086..bf4b08cd1 100644
--- a/src/I18n.tsx
+++ b/src/I18n.tsx
@@ -10,7 +10,7 @@ const translations = generatedTranslations();
10 10
11type Props = { 11type Props = {
12 stores: { 12 stores: {
13 app: typeof AppStore; 13 app: AppStore;
14 user: typeof UserStore; 14 user: typeof UserStore;
15 }; 15 };
16 children: ReactNode; 16 children: ReactNode;
@@ -21,14 +21,16 @@ class I18N extends Component<Props> {
21 window['ferdium'].menu.rebuild(); 21 window['ferdium'].menu.rebuild();
22 } 22 }
23 23
24 render() { 24 render(): ReactNode {
25 const { stores, children } = this.props; 25 const { stores, children } = this.props;
26 const { locale } = stores.app; 26 const { locale } = stores.app;
27 return ( 27 return (
28 <IntlProvider 28 <IntlProvider
29 {...{ locale, key: locale, messages: translations[locale] }} 29 {...{ locale, key: locale, messages: translations[locale] }}
30 ref={intlProvider => { 30 ref={intlProvider => {
31 window['ferdium'].intl = intlProvider ? intlProvider.state.intl : null; 31 window['ferdium'].intl = intlProvider
32 ? intlProvider.state.intl
33 : null;
32 }} 34 }}
33 > 35 >
34 {children} 36 {children}