From: Alan Knowles Date: Thu, 6 Oct 2011 07:54:59 +0000 (+0800) Subject: Pman.I18n.js X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=39537d5266e119e4198585e8cae805908d60684d Pman.I18n.js --- 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 ]); });