PLT-6935 Fixes issue when locale set to unknown (#6829)

This commit is contained in:
Corey Hulen
2017-07-03 10:26:30 -07:00
committed by enahum
parent 171a788715
commit e60c6dec19

View File

@@ -356,15 +356,15 @@ export function sendEphemeralPost(message, channelId) {
}
export function newLocalizationSelected(locale) {
if (locale === 'en') {
const localeInfo = I18n.getLanguageInfo(locale);
if (locale === 'en' || !localeInfo) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_LOCALE,
locale,
translations: en
});
} else {
const localeInfo = I18n.getLanguageInfo(locale);
Client4.getTranslations(localeInfo.url).then(
(data, res) => {
let translations = data;