DataObjects/Core_enum.php
[Pman.Core] / Pman.I18n.js
index 435d9ed..82409f1 100644 (file)
@@ -47,11 +47,17 @@ Pman.I18n = {
     toName: function(type, code) 
     {
         var ret = code;
-        var lang = Pman.Login.authUser.lang || 'en';
+        
+        var lang = 'en';
+        
+        if(typeof(Pman.Login) != 'undefined' && typeof(Pman.Login.authUser.lang) == 'undefined'){
+            lang = Pman.Login.authUser.lang;
+        }
+        
         if (code.indexOf('_') > -1) {
             var clang = code.split('_').shift();
             var cc = code.split('_').pop();
-            return this.toName('l', clang.toUpperCase()) + ' (' +  this.toName('c', cc.toUpperCase()) + ')';
+            return this.toName('l', clang.toLowerCase()) + ' (' +  this.toName('c', cc.toUpperCase()) + ')';
         }