From: Mike Taylor Date: Mon, 8 Jul 2013 11:52:16 +0000 (+0100) Subject: Support for custom languages, specifed as an mkws_config key of the X-Git-Tag: 0.9.1~306^2~10 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;ds=sidebyside;h=8be73070fab0ee5ce9d67886fe48a68147051446;p=mkws-moved-to-github.git Support for custom languages, specifed as an mkws_config key of the form "language_NAME" whose value is a hash like the built-in languages. --- diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 4c75a8c..64b2755 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -76,6 +76,18 @@ var mkws_locale_lang = { } }; + +for (var key in mkws_config) { + if (mkws_config.hasOwnProperty(key)) { + if (key.match(/^language_/)) { + var lang = key.replace(/^language_/, ""); + // Copy custom languages into list + mkws_locale_lang[lang] = mkws_config[key]; + } + } +} + + // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default