From b5e7237169eecdeae0066070f2213e0f5ec8eda6 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 22 Jan 2019 17:54:18 +0300 Subject: [PATCH] Update components on language change --- client/src/install/Setup/Devices.js | 4 ++-- client/src/install/Setup/Greeting.js | 4 ++-- client/src/install/Setup/Progress.js | 4 ++-- client/src/install/Setup/Settings.js | 16 ++++++++++------ client/src/install/Setup/Submit.js | 16 ++++++++++------ 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/client/src/install/Setup/Devices.js b/client/src/install/Setup/Devices.js index 0a13b095..54788ce8 100644 --- a/client/src/install/Setup/Devices.js +++ b/client/src/install/Setup/Devices.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Trans } from 'react-i18next'; +import { Trans, withNamespaces } from 'react-i18next'; import Tabs from '../../components/ui/Tabs'; import Icons from '../../components/ui/Icons'; @@ -90,4 +90,4 @@ const Devices = () => ( ); -export default Devices; +export default withNamespaces()(Devices); diff --git a/client/src/install/Setup/Greeting.js b/client/src/install/Setup/Greeting.js index 0398e5af..4f9a82d6 100644 --- a/client/src/install/Setup/Greeting.js +++ b/client/src/install/Setup/Greeting.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Trans } from 'react-i18next'; +import { Trans, withNamespaces } from 'react-i18next'; import Controls from './Controls'; class Greeting extends Component { @@ -20,4 +20,4 @@ class Greeting extends Component { } } -export default Greeting; +export default withNamespaces()(Greeting); diff --git a/client/src/install/Setup/Progress.js b/client/src/install/Setup/Progress.js index db44b8c4..76f161f6 100644 --- a/client/src/install/Setup/Progress.js +++ b/client/src/install/Setup/Progress.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Trans } from 'react-i18next'; +import { Trans, withNamespaces } from 'react-i18next'; import { INSTALL_TOTAL_STEPS } from '../../helpers/constants'; @@ -22,4 +22,4 @@ Progress.propTypes = { step: PropTypes.number.isRequired, }; -export default Progress; +export default withNamespaces()(Progress); diff --git a/client/src/install/Setup/Settings.js b/client/src/install/Setup/Settings.js index 6735463a..4a357827 100644 --- a/client/src/install/Setup/Settings.js +++ b/client/src/install/Setup/Settings.js @@ -2,7 +2,8 @@ import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { Field, reduxForm, formValueSelector } from 'redux-form'; -import { Trans } from 'react-i18next'; +import { Trans, withNamespaces } from 'react-i18next'; +import flow from 'lodash/flow'; import Controls from './Controls'; import renderField from './renderField'; @@ -153,8 +154,11 @@ Settings = connect((state) => { }; })(Settings); -export default reduxForm({ - form: 'install', - destroyOnUnmount: false, - forceUnregisterOnUnmount: true, -})(Settings); +export default flow([ + withNamespaces(), + reduxForm({ + form: 'install', + destroyOnUnmount: false, + forceUnregisterOnUnmount: true, + }), +])(Settings); diff --git a/client/src/install/Setup/Submit.js b/client/src/install/Setup/Submit.js index 9f52a2df..a497dc69 100644 --- a/client/src/install/Setup/Submit.js +++ b/client/src/install/Setup/Submit.js @@ -1,7 +1,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { reduxForm } from 'redux-form'; -import { Trans } from 'react-i18next'; +import { Trans, withNamespaces } from 'react-i18next'; +import flow from 'lodash/flow'; import Controls from './Controls'; @@ -37,8 +38,11 @@ Submit.propTypes = { submitting: PropTypes.bool.isRequired, }; -export default reduxForm({ - form: 'install', - destroyOnUnmount: false, - forceUnregisterOnUnmount: true, -})(Submit); +export default flow([ + withNamespaces(), + reduxForm({ + form: 'install', + destroyOnUnmount: false, + forceUnregisterOnUnmount: true, + }), +])(Submit);