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/user_settings/user_settings_display.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/user_settings/user_settings_display.jsx')
-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 16175d4de..98d4ed7da 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -641,7 +641,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} @@ -652,7 +656,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 |