X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.I18n.js;h=7af491cdc8ff012ab3fd77991192330191e9fcd4;hp=a264232d18ebf1d951a90ee4096452c76f77d6bb;hb=c1af5e6bb6064e88469651271f4d9aaff34d69c0;hpb=55445829af4a092b47451bc18cff780dc52b35d0 diff --git a/Pman.I18n.js b/Pman.I18n.js index a264232d..7af491cd 100644 --- a/Pman.I18n.js +++ b/Pman.I18n.js @@ -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()) + ')'; } @@ -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; }); @@ -177,7 +183,7 @@ Pman.I18n = { xtype: 'Store', proxy: { xtype: 'HttpProxy', - url: baseURL + '/I18N/Country.html', + url: baseURL + '/Core/I18n/Country.html', method: 'GET' }, @@ -199,15 +205,13 @@ Pman.I18n = { xtype: 'Store', proxy: { xtype: 'HttpProxy', - url: baseURL + '/I18N/Lang.html', + url: baseURL + '/Core/I18n/Lang.html', method: 'GET' }, reader: Pman.I18n.reader, listeners : { - loadexception : Pman.loadException - }, remoteSort: false, sortInfo: { @@ -220,7 +224,7 @@ Pman.I18n = { xtype: 'Store', proxy: { xtype: 'HttpProxy', - url: baseURL + '/I18N/Currency.html', + url: baseURL + '/Core/I18n/Currency.html', method: 'GET' },