* includes standard pulldowns.
*/
-Pmnan.on('load', Pman.I18n.onReady, this)
+
Pman.I18n = {
- /**
- * onReady: called on page load to fix 'other' translation.
- *
- * We have a special country/languages called 'other', which is used to handle
- * odd situations.
- *
- * To enable it to be translated, we need to change it's value after the pages is loaded..
- *
- */
- onReady : function()
- {
- var d = this.Data;
-
-
-
-
- }
/**
* turn zh_HK,en => into Chinese(HK) , English
if (code.indexOf('_') > -1) {
var clang = code.split('_').shift();
var cc = code.split('_').pop();
- return this.toName('l', clang) + ' (' + cc + ')';
+ return this.toName('l', clang.toLowerCase()) + ' (' + this.toName('c', cc.toUpperCase()) + ')';
}
ret = d.title;
return false; // stop!
}
+ return true;
});
return ret;
return Pman.I18n.Data[lang][type];
},
- simpleStoreData : function(type)
+ /**
+ * simpleStoreData:
+ * return a simplestore to be used by country/language combos
+ * eg.
+ * store: (function() {
+ return Pman.I18n.simpleStoreData('c');
+ })(),
+ *
+ * @param {Char} type (c,l,m)
+ * @param {function} (optional) filter language list
+ * called with object { code: xxx , title: xxx }
+ * if it exists then returning false will hide the entry.
+ */
+
+ simpleStoreData : function(type, filter)
{
+ filter = typeof(filter) == 'undefined' ? false : filter;
var lang = 'en';
try {
lang = Pman.Login.authUser.lang;
lang = lang || 'en';
var ret = [];
Roo.each(Pman.I18n.Data[lang][type], function (o) {
+ if (filter !== false && filter(o) === false) {
+ return;
+ }
ret.push([ o.code, o.title ]);
});
xtype: 'Store',
proxy: {
xtype: 'HttpProxy',
- url: baseURL + '/I18N/Country.html',
+ url: baseURL + '/Core/I18n/Country.html',
method: 'GET'
},
xtype: 'Store',
proxy: {
xtype: 'HttpProxy',
- url: baseURL + '/I18N/Lang.html',
+ url: baseURL + '/Core/I18n/Lang.html',
method: 'GET'
},
xtype: 'Store',
proxy: {
xtype: 'HttpProxy',
- url: baseURL + '/I18N/Currency.html',
+ url: baseURL + '/Core/I18n/Currency.html',
method: 'GET'
},
};
-
-
+