diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-01 09:56:13 -0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-06-01 08:56:13 -0400 |
commit | b00a60ab71b2bd4640c8608d71805ba9caae97d9 (patch) | |
tree | 02137b19bc56e5041530e710955f039682da43c7 /webapp/components/root.jsx | |
parent | 7be2a05cf58c22d1edfab12a2b55569c5e48ab2f (diff) | |
download | chat-b00a60ab71b2bd4640c8608d71805ba9caae97d9.tar.gz chat-b00a60ab71b2bd4640c8608d71805ba9caae97d9.tar.bz2 chat-b00a60ab71b2bd4640c8608d71805ba9caae97d9.zip |
PLT-1800 Load server side locale from the config.json (#3135)
* PLT-1800 Load server side locale from the config.json
* Add support for locales with country specifics
* Fix localization on served locale file as plain/text
* Remove github.com/cloudfoundry/jibber_jabber as vendor dependency
Diffstat (limited to 'webapp/components/root.jsx')
-rw-r--r-- | webapp/components/root.jsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/webapp/components/root.jsx b/webapp/components/root.jsx index c96499392..abaa05bb5 100644 --- a/webapp/components/root.jsx +++ b/webapp/components/root.jsx @@ -6,6 +6,7 @@ import * as GlobalActions from 'actions/global_actions.jsx'; import LocalizationStore from 'stores/localization_store.jsx'; +import Client from 'utils/web_client.jsx'; import {IntlProvider} from 'react-intl'; @@ -41,7 +42,10 @@ export default class Root extends React.Component { FastClick.attach(document.body); } localizationChanged() { - this.setState({locale: LocalizationStore.getLocale(), translations: LocalizationStore.getTranslations()}); + const locale = LocalizationStore.getLocale(); + + Client.setAcceptLanguage(locale); + this.setState({locale, translations: LocalizationStore.getTranslations()}); } redirectIfNecessary(props) { @@ -67,7 +71,7 @@ export default class Root extends React.Component { LocalizationStore.addChangeListener(this.localizationChanged); // Get our localizaiton - GlobalActions.loadBrowserLocale(); + GlobalActions.loadDefaultLocale(); } componentWillUnmount() { LocalizationStore.removeChangeListener(this.localizationChanged); |