From ec7a273550a1aaf31e80abc90c99d06a94664b5d Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Fri, 27 May 2016 09:01:35 -0400
Subject: Revert "PLT-1800 Load server side locale from the config.json"
 (#3133)

---
 webapp/i18n/i18n.jsx | 40 ++++++----------------------------------
 1 file changed, 6 insertions(+), 34 deletions(-)

(limited to 'webapp/i18n/i18n.jsx')

diff --git a/webapp/i18n/i18n.jsx b/webapp/i18n/i18n.jsx
index 783cef975..2214fd386 100644
--- a/webapp/i18n/i18n.jsx
+++ b/webapp/i18n/i18n.jsx
@@ -4,7 +4,7 @@
 const es = require('!!file?name=i18n/[name].[ext]!./es.json');
 const fr = require('!!file?name=i18n/[name].[ext]!./fr.json');
 const ja = require('!!file?name=i18n/[name].[ext]!./ja.json');
-const pt_BR = require('!!file?name=i18n/[name].[ext]!./pt-BR.json'); //eslint-disable-line camelcase
+const pt = require('!!file?name=i18n/[name].[ext]!./pt.json');
 
 import {addLocaleData} from 'react-intl';
 import enLocaleData from 'react-intl/locale-data/en';
@@ -34,47 +34,19 @@ const languages = {
         name: '日本語 (Beta)',
         url: ja
     },
-    'pt-BR': {
-        value: 'pt-BR',
+    pt: {
+        value: 'pt',
         name: 'Portugues (Beta)',
-        url: pt_BR
+        url: pt
     }
 };
 
-let availableLanguages = null;
-
-function setAvailableLanguages() {
-    const available = global.window.mm_config.AvailableLocales.split(',');
-
-    availableLanguages = {};
-
-    available.forEach((l) => {
-        if (languages[l]) {
-            availableLanguages[l] = languages[l];
-        }
-    });
-}
-
-export function getAllLanguages() {
-    return languages;
-}
-
 export function getLanguages() {
-    if (!availableLanguages) {
-        setAvailableLanguages();
-    }
-    return availableLanguages;
+    return languages;
 }
 
 export function getLanguageInfo(locale) {
-    if (!availableLanguages) {
-        setAvailableLanguages();
-    }
-    return availableLanguages[locale];
-}
-
-export function isLanguageAvailable(locale) {
-    return !!availableLanguages[locale];
+    return languages[locale];
 }
 
 export function safariFix(callback) {
-- 
cgit v1.2.3-1-g7c22

