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
Этот коммит содержится в:
enahum
2016-05-24 09:36:27 -03:00
коммит произвёл Joram Wilander
родитель 79c0b20689
Коммит 34beaa569b
24 изменённых файлов: 377 добавлений и 51 удалений

Просмотреть файл

@@ -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