summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings/user_settings_display.jsx
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-05-27 09:25:37 -0300
committerJoram Wilander <jwawilander@gmail.com>2016-05-27 08:25:37 -0400
commita2c183f401bdf8e9abddd35d4561d42034325046 (patch)
tree66565a9e21ad6b47b4dca18113ad9be48bd98492 /webapp/components/user_settings/user_settings_display.jsx
parent15e427e806716b372f7fbef12d922f847ccc71b5 (diff)
downloadchat-a2c183f401bdf8e9abddd35d4561d42034325046.tar.gz
chat-a2c183f401bdf8e9abddd35d4561d42034325046.tar.bz2
chat-a2c183f401bdf8e9abddd35d4561d42034325046.zip
PLT-1800 Load server side locale from the config.json (#3092)
* 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
Diffstat (limited to 'webapp/components/user_settings/user_settings_display.jsx')
-rw-r--r--webapp/components/user_settings/user_settings_display.jsx11
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