'use strict';

angular.module('<%=angularAppName%>')
    .controller('LanguageController', function ($scope, $translate, Language, tmhDynamicLocale) {
        $scope.changeLanguage = function (languageKey) {
            $translate.use(languageKey);
            tmhDynamicLocale.set(languageKey);
        };

        Language.getAll().then(function (languages) {
            $scope.languages = languages;
        });
    })
    .filter('findLanguageFromKey', function () {
        return function (lang) {
            return {
                "ca": "Català",
                "da": "Dansk",
                "de": "Deutsch",
                "en": "English",
                "es": "Español",
                "fr": "Français",
                "gl": "Galego",
                "hu": "Magyar",
                "it": "Italiano",
                "ja": "日本語",
                "ko": "한국어",
                "nl": "Nederlands",
                "pl": "Polski",
                "pt-br": "Português (Brasil)",
                "pt-pt": "Português",
                "ro": "Română",
                "ru": "Русский",
                "sv": "Svenska",
                "ta": "தமிழ்",
                "tr": "Türkçe",
                "zh-cn": "中文（简体）",
                "zh-tw": "繁體中文"
            }[lang];
        }
    });

@@ -539,22 +539,22 @@
     
-%22ca%22: %22
+'ca': '
 Catal%C3%A0
-%22
+'
 ,%0A  
@@ -571,21 +571,21 @@
     
-%22da%22: %22
+'da': '
 Dansk
-%22
+'
 ,%0A  
@@ -602,23 +602,23 @@
     
-%22de%22: %22
+'de': '
 Deutsch
-%22
+'
 ,%0A  
@@ -635,23 +635,23 @@
     
-%22en%22: %22
+'en': '
 English
-%22
+'
 ,%0A  
@@ -668,23 +668,23 @@
     
-%22es%22: %22
+'es': '
 Espa%C3%B1ol
-%22
+'
 ,%0A  
@@ -701,23 +701,23 @@
     
-%22fr%22: %22
+'fr': '
 Fran%C3%A7ais
 %22,%0A 
@@ -712,17 +712,17 @@
 Fran%C3%A7ais
-%22
+'
 ,%0A      
@@ -735,22 +735,22 @@
     
-%22gl%22: %22
+'gl': '
 Galego
-%22
+'
 ,%0A  
@@ -767,22 +767,22 @@
     
-%22hu%22: %22
+'hu': '
 Magyar
-%22
+'
 ,%0A  
@@ -799,23 +799,23 @@
     
-%22it%22: %22
+'it': '
 Italiano
 %22,%0A 
@@ -810,17 +810,17 @@
 Italiano
-%22
+'
 ,%0A      
@@ -833,19 +833,19 @@
     
-%22ja%22: %22%E6%97%A5%E6%9C%AC%E8%AA%9E%22
+'ja': '%E6%97%A5%E6%9C%AC%E8%AA%9E'
 ,%0A  
@@ -862,19 +862,19 @@
     
-%22ko%22: %22%ED%95%9C%EA%B5%AD%EC%96%B4%22
+'ko': '%ED%95%9C%EA%B5%AD%EC%96%B4'
 ,%0A  
@@ -891,15 +891,15 @@
     
-%22nl%22: %22
+'nl': '
 Nede
@@ -904,17 +904,17 @@
 derlands
-%22
+'
 ,%0A      
@@ -927,22 +927,22 @@
     
-%22pl%22: %22
+'pl': '
 Polski
-%22
+'
 ,%0A  
@@ -959,18 +959,18 @@
     
-%22
+'
 pt-br
-%22: %22
+': '
 Port
@@ -983,17 +983,17 @@
 (Brasil)
-%22
+'
 ,%0A      
@@ -1006,18 +1006,18 @@
     
-%22
+'
 pt-pt
-%22: %22
+': '
 Port
@@ -1021,17 +1021,17 @@
 ortugu%C3%AAs
-%22
+'
 ,%0A      
@@ -1044,22 +1044,22 @@
     
-%22ro%22: %22
+'ro': '
 Rom%C3%A2n%C4%83
-%22
+'
 ,%0A  
@@ -1076,23 +1076,23 @@
     
-%22ru%22: %22
+'ru': '
 %D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9
-%22
+'
 ,%0A  
@@ -1109,23 +1109,23 @@
     
-%22sv%22: %22
+'sv': '
 Svenska
-%22
+'
 ,%0A  
@@ -1142,21 +1142,21 @@
     
-%22ta%22: %22
+'ta': '
 %E0%AE%A4%E0%AE%AE%E0%AE%BF%E0%AE%B4%E0%AF%8D
-%22
+'
 ,%0A  
@@ -1173,22 +1173,22 @@
     
-%22tr%22: %22
+'tr': '
 T%C3%BCrk%C3%A7e
-%22
+'
 ,%0A  
@@ -1205,25 +1205,25 @@
     
-%22
+'
 zh-cn
-%22: %22
+': '
 %E4%B8%AD%E6%96%87%EF%BC%88%E7%AE%80%E4%BD%93%EF%BC%89
-%22
+'
 ,%0A  
@@ -1240,23 +1240,23 @@
     
-%22
+'
 zh-tw
-%22: %22
+': '
 %E7%B9%81%E9%AB%94%E4%B8%AD%E6%96%87
-%22
+'
 %0A   
@@ -1273,16 +1273,16 @@
 %5Blang%5D;%0A
-
         
@@ -1282,16 +1282,17 @@
        %7D
+;
 %0A    %7D);

clean up client code in /app/components/language following jshint guidelines