From 39537d5266e119e4198585e8cae805908d60684d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 6 Oct 2011 15:54:59 +0800 Subject: [PATCH] Pman.I18n.js --- Pman.I18n.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Pman.I18n.js b/Pman.I18n.js index e44de6b9..55eacf38 100644 --- a/Pman.I18n.js +++ b/Pman.I18n.js @@ -131,7 +131,21 @@ Pman.I18n = { 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) { var lang = 'en'; try { @@ -140,6 +154,9 @@ Pman.I18n = { lang = lang || 'en'; var ret = []; Roo.each(Pman.I18n.Data[lang][type], function (o) { + if (filter && filter(o) === false) { + return; + } ret.push([ o.code, o.title ]); }); -- 2.39.2