[open-ils-commits] r10201 - in
trunk/Open-ILS/web/opac/skin/default/xml: . common
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jul 30 23:56:31 EDT 2008
Author: miker
Date: 2008-07-30 23:56:24 -0400 (Wed, 30 Jul 2008)
New Revision: 10201
Modified:
trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
trunk/Open-ILS/web/opac/skin/default/xml/footer.xml
Log:
dojo-based locale switcher
Modified: trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2008-07-31 03:28:55 UTC (rev 10200)
+++ trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2008-07-31 03:56:24 UTC (rev 10201)
@@ -35,12 +35,16 @@
<!-- enable Dojo date picker -->
<script language='javascript' type="text/javascript">
+
var djConfig = {parseOnLoad: true, isDebug: false},
- locale,
lang,
bidi;
- djConfig.locale = '<!--#echo var="locale"-->';
+ var locale = location.href.match( /opac\/([^\/]+)\/skin/ )[0];
+ if (!locale) locale = '<!--#echo var="locale"-->';
+
+ djConfig.locale = locale;
+
</script>
<script type="text/javascript" src='/js/dojo/dojo/dojo.js'></script>
@@ -51,4 +55,6 @@
dojo.require("dojo.date.locale");
dojo.require("dojo.date.stamp");
dojo.require("dojo.parser");
+ dojo.require("openils.I18N");
+ dojo.require("dijit.form.FilteringSelect");
</script>
Modified: trunk/Open-ILS/web/opac/skin/default/xml/footer.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/footer.xml 2008-07-31 03:28:55 UTC (rev 10200)
+++ trunk/Open-ILS/web/opac/skin/default/xml/footer.xml 2008-07-31 03:56:24 UTC (rev 10201)
@@ -31,4 +31,12 @@
<div id='footer_logo'>&footer.logo;
<a href='http://open-ils.org'><img style='border:none;' src='../../../../images/eg_tiny_logo.jpg'/></a>
</div>
+
+ <div id='translation_switch' dojoType="dijit.form.FilteringSelect" store="openils.I18N.localeStore" searchAttr="locale" displayAttr="label">
+ <script type="dojo/connect" event="onChange">
+ if (this.getValue()) {
+ location.href.replace( /opac\/[^\/]+\/skin/, 'opac/' + this.getValue() + '/skin');
+ }
+ </script>
+ </div>
</div>
More information about the open-ils-commits
mailing list