aboutsummaryrefslogtreecommitdiffstats
path: root/src/I18n.js
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-11-18 17:37:45 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-18 22:07:45 +0530
commitb37a6b07b39c8c7827052dc6fb97f490f1e0f514 (patch)
tree0276e7c51f5ebfa14c566def7aac39f014c2291d /src/I18n.js
parentUpdate github issues template [skip ci] (diff)
downloadferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.tar.gz
ferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.tar.zst
ferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.zip
chore: convert various files to TS (#2246)
* convert various files to TS * removed outdated docs/example-feature folder * turn off unicorn/no-empty-file * update eslint config
Diffstat (limited to 'src/I18n.js')
-rw-r--r--src/I18n.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/I18n.js b/src/I18n.js
deleted file mode 100644
index b10c5a94b..000000000
--- a/src/I18n.js
+++ /dev/null
@@ -1,42 +0,0 @@
1import { Component } from 'react';
2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react';
4import { IntlProvider } from 'react-intl';
5
6import { oneOrManyChildElements } from './prop-types';
7import translations from './i18n/translations';
8import UserStore from './stores/UserStore';
9import AppStore from './stores/AppStore';
10
11@inject('stores')
12@observer
13class I18N extends Component {
14 componentDidUpdate() {
15 window['ferdi'].menu.rebuild();
16 }
17
18 render() {
19 const { stores, children } = this.props;
20 const { locale } = stores.app;
21 return (
22 <IntlProvider
23 {...{ locale, key: locale, messages: translations[locale] }}
24 ref={intlProvider => {
25 window['ferdi'].intl = intlProvider ? intlProvider.state.intl : null;
26 }}
27 >
28 {children}
29 </IntlProvider>
30 );
31 }
32}
33
34I18N.wrappedComponent.propTypes = {
35 stores: PropTypes.shape({
36 app: PropTypes.instanceOf(AppStore).isRequired,
37 user: PropTypes.instanceOf(UserStore).isRequired,
38 }).isRequired,
39 children: oneOrManyChildElements.isRequired,
40};
41
42export default I18N;