[open-ils-commits] r18721 - branches/rel_2_0/Open-ILS/web/js/dojo/openils (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 12 15:40:21 EST 2010
Author: miker
Date: 2010-11-12 15:40:17 -0500 (Fri, 12 Nov 2010)
New Revision: 18721
Modified:
branches/rel_2_0/Open-ILS/web/js/dojo/openils/I18N.js
Log:
Cache the language set (per locale) in a cookie
Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/I18N.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/I18N.js 2010-11-12 20:40:12 UTC (rev 18720)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/I18N.js 2010-11-12 20:40:17 UTC (rev 18721)
@@ -25,7 +25,18 @@
dojo.declare('openils.I18N', null, {});
- openils.I18N.BaseLocales = fieldmapper.standardRequest( [ 'open-ils.fielder', 'open-ils.fielder.i18n_l.atomic'], [ { cache : 1, query : { code : { '!=' : null } } } ] );
+ var x = dojo.cookie('I18Nset');
+ if (x) {
+ openils.I18N.BaseLocales = dojo.fromJson(x);
+ } else {
+ openils.I18N.BaseLocales = fieldmapper.standardRequest( [ 'open-ils.fielder', 'open-ils.fielder.i18n_l.atomic'], [ { cache : 1, query : { code : { '!=' : null } } } ] );
+ dojo.cookie(
+ 'I18Nset',
+ dojo.toJson(openils.I18N.BaseLocales),
+ { path : location.href.replace(/^https?:\/\/[^\/]+(\/.*\w{2}-\w{2}\/).*/, "$1") }
+ );
+ }
+
openils.I18N.localeStore = new dojo.data.ItemFileWriteStore( { data : {identifier : 'locale', label : 'label', items : [] } } );
openils.I18N.BaseLocales = openils.I18N.BaseLocales.sort(
function(a, b) {
More information about the open-ils-commits
mailing list