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
Этот коммит содержится в:
enahum
2016-05-27 09:25:37 -03:00
коммит произвёл Joram Wilander
родитель 15e427e806
Коммит a2c183f401
24 изменённых файлов: 396 добавлений и 66 удалений

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

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