summaryrefslogtreecommitdiffstats
path: root/webapp/components/root.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-05-24 09:36:27 -0300
committerJoram Wilander <jwawilander@gmail.com>2016-05-24 08:36:27 -0400
commit34beaa569bfb32f1607375f1d5a22859322060d2 (patch)
treec5d264e383890c88263db071a555201e4bc8e159 /webapp/components/root.jsx
parent79c0b206895ce6c5ffa498cdc80edbd821ff5469 (diff)
downloadchat-34beaa569bfb32f1607375f1d5a22859322060d2.tar.gz
chat-34beaa569bfb32f1607375f1d5a22859322060d2.tar.bz2
chat-34beaa569bfb32f1607375f1d5a22859322060d2.zip
PLT-1800 Load server side locale from the config.json (#3076)
* PLT-1800 Load server side locale from the config.json * Add support for locales with country specifics
Diffstat (limited to 'webapp/components/root.jsx')
-rw-r--r--webapp/components/root.jsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/webapp/components/root.jsx b/webapp/components/root.jsx
index 0adbc7f04..d27a6d8ac 100644
--- a/webapp/components/root.jsx
+++ b/webapp/components/root.jsx
@@ -6,6 +6,7 @@
import * as GlobalActions from 'action_creators/global_actions.jsx';
import LocalizationStore from 'stores/localization_store.jsx';
+import Client from 'utils/web_client.jsx';
import {IntlProvider} from 'react-intl';
@@ -28,7 +29,10 @@ export default class Root extends React.Component {
this.redirectIfNecessary = this.redirectIfNecessary.bind(this);
}
localizationChanged() {
- this.setState({locale: LocalizationStore.getLocale(), translations: LocalizationStore.getTranslations()});
+ const locale = LocalizationStore.getLocale();
+
+ Client.setAcceptLanguage(locale);
+ this.setState({locale, translations: LocalizationStore.getTranslations()});
}
redirectIfNecessary(props) {
@@ -63,7 +67,7 @@ export default class Root extends React.Component {
FastClick.attach(document.body);
// Get our localizaiton
- GlobalActions.loadBrowserLocale();
+ GlobalActions.loadDefaultLocale();
// Redirect if Necessary
this.redirectIfNecessary(this.props);