From 903c1da993c24ab4a338a3cee22c947a8fcc2e19 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 26 Nov 2018 11:48:06 +0300 Subject: [PATCH] Remove change_language call on loading app --- client/src/actions/index.js | 3 +-- client/src/components/App/index.js | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/actions/index.js b/client/src/actions/index.js index 3e5b38bc..a4da8c9a 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -500,8 +500,7 @@ export const changeLanguageSuccess = createAction('CHANGE_LANGUAGE_SUCCESS'); export const changeLanguage = lang => async (dispatch) => { dispatch(changeLanguageRequest()); try { - const langCode = lang.substring(0, 2); - await apiClient.changeLanguage(langCode); + await apiClient.changeLanguage(lang); dispatch(changeLanguageSuccess()); } catch (error) { dispatch(addErrorToast({ error })); diff --git a/client/src/components/App/index.js b/client/src/components/App/index.js index 98c37afa..74bc6960 100644 --- a/client/src/components/App/index.js +++ b/client/src/components/App/index.js @@ -39,9 +39,7 @@ class App extends Component { const { processing, language } = this.props.dashboard; if (!processing) { - if (!language) { - this.props.changeLanguage(i18n.language); - } else { + if (language) { i18n.changeLanguage(language); } }