diff options
author | enahum <nahumhbl@gmail.com> | 2016-05-24 09:36:27 -0300 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-05-24 08:36:27 -0400 |
commit | 34beaa569bfb32f1607375f1d5a22859322060d2 (patch) | |
tree | c5d264e383890c88263db071a555201e4bc8e159 /webapp/components/user_settings | |
parent | 79c0b206895ce6c5ffa498cdc80edbd821ff5469 (diff) | |
download | chat-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/user_settings')
-rw-r--r-- | webapp/components/user_settings/user_settings_display.jsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/webapp/components/user_settings/user_settings_display.jsx b/webapp/components/user_settings/user_settings_display.jsx index fa0118d1e..27e7c93a4 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -632,7 +632,11 @@ export default class UserSettingsDisplay extends React.Component { ); } + const userLocale = this.props.user.locale; if (this.props.activeSection === 'languages') { + if (!I18n.isLanguageAvailable(userLocale)) { + this.props.user.locale = global.window.mm_config.DefaultClientLocale; + } languagesSection = ( <ManageLanguages user={this.props.user} @@ -643,7 +647,12 @@ export default class UserSettingsDisplay extends React.Component { /> ); } else { - var locale = I18n.getLanguageInfo(this.props.user.locale).name; + let locale; + if (I18n.isLanguageAvailable(userLocale)) { + locale = I18n.getLanguageInfo(userLocale).name; + } else { + locale = I18n.getLanguageInfo(global.window.mm_config.DefaultClientLocale).name; + } languagesSection = ( <SettingItemMin |