From: miker Date: Thu, 24 Jul 2008 17:58:20 +0000 (+0000) Subject: pull valid locales from the configured set in the database X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c84888b62a5cedbf6a8070c10742f8f507eebc89;p=Evergreen.git pull valid locales from the configured set in the database git-svn-id: svn://svn.open-ils.org/ILS/trunk@10119 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/I18N.js b/Open-ILS/web/js/dojo/openils/I18N.js index 215a530400..b90fa97fe4 100644 --- a/Open-ILS/web/js/dojo/openils/I18N.js +++ b/Open-ILS/web/js/dojo/openils/I18N.js @@ -25,20 +25,11 @@ if(!dojo._hasResource["openils.I18N"]) { dojo.declare('openils.I18N', null, {}); - openils.I18N.BaseLocales = { - "en" : "English", - "en_us" : "US English", - "en_ca" : "Canadian English", - "es" : "Spanish", - "es_us" : "US Spanish", - "fr" : "French", - "fr_ca" : "Canadian French" - }; - + openils.I18N.BaseLocales = fieldmapper.standardRequest( [ 'open-ils.fielder', 'open-ils.fielder.i18n_l.atomic'], [ { query : { code : { '!=' : null } } } ] ); openils.I18N.localeStore = new dojo.data.ItemFileWriteStore( { data : {identifier : 'locale', label : 'label', items : [] } } ); for (var i in openils.I18N.BaseLocales) { - openils.I18N.localeStore.newItem({ locale : i, label : openils.I18N.BaseLocales[i] }); + openils.I18N.localeStore.newItem({ locale : openils.I18N.BaseLocales[i].code, label : openils.I18N.BaseLocales[i].name }); } openils.I18N.getTranslations = function ( obj /* Fieldmapper object */, field /* Field to translate */, locale /* optional locale */) {