[open-ils-commits] r18719 - trunk/Open-ILS/web/js/dojo/openils (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 12 15:39:14 EST 2010
Author: miker
Date: 2010-11-12 15:39:09 -0500 (Fri, 12 Nov 2010)
New Revision: 18719
Modified:
trunk/Open-ILS/web/js/dojo/openils/I18N.js
Log:
Cache the language set (per locale) in a cookie
Modified: trunk/Open-ILS/web/js/dojo/openils/I18N.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/I18N.js 2010-11-12 20:37:37 UTC (rev 18718)
+++ trunk/Open-ILS/web/js/dojo/openils/I18N.js 2010-11-12 20:39:09 UTC (rev 18719)
@@ -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