X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Pman.I18n.js;h=7af491cdc8ff012ab3fd77991192330191e9fcd4;hb=c09df6ba25e12f8223b4c58989986b2e9efedecb;hp=a47f072e8cb90a6d2e8fb9485bc8d08e91a33cae;hpb=15da5a36259e48ac94efaa1dcdb1dd365210e617;p=Pman.Core diff --git a/Pman.I18n.js b/Pman.I18n.js index a47f072e..7af491cd 100644 --- a/Pman.I18n.js +++ b/Pman.I18n.js @@ -47,7 +47,13 @@ Pman.I18n = { toName: function(type, code) { var ret = code; - var lang = typeof(Pman.Login.authUser.lang) == 'undefined' ? 'en' : Pman.Login.authUser.lang; + + 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(); @@ -163,8 +169,8 @@ Pman.I18n = { }); ret = ret.sort(function(a,b) { - if (a[0] == '**') return 1; // other always at end.. - if (b[0] == '**') return -1; // other always at end.. + if (a[0] == '**') { return 1; } // other always at end.. + if (b[0] == '**') { return -1; } // other always at end.. return a[1] > b[1] ? 1 : -1; }); @@ -205,9 +211,7 @@ Pman.I18n = { reader: Pman.I18n.reader, listeners : { - loadexception : Pman.loadException - }, remoteSort: false, sortInfo: {