[open-ils-commits] r10827 - in trunk/Open-ILS/web: conify/global conify/global/actor js/dojo/openils js/dojo/openils/conify js/dojo/openils/conify/nls opac/locale/en-US

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Oct 13 22:39:15 EDT 2008


Author: dbs
Date: 2008-10-13 22:39:13 -0400 (Mon, 13 Oct 2008)
New Revision: 10827

Added:
   trunk/Open-ILS/web/js/dojo/openils/conify/
   trunk/Open-ILS/web/js/dojo/openils/conify/nls/
   trunk/Open-ILS/web/js/dojo/openils/conify/nls/aout.js
   trunk/Open-ILS/web/opac/locale/en-US/conify.dtd
Modified:
   trunk/Open-ILS/web/conify/global/actor/org_unit_type.html
   trunk/Open-ILS/web/conify/global/actor/org_unit_type.js
   trunk/Open-ILS/web/conify/global/admin.html
Log:
Start making it possible to localize Conify.
Using a combination of mod_xmlent and dojo string substitution for the nonce.


Modified: trunk/Open-ILS/web/conify/global/actor/org_unit_type.html
===================================================================
--- trunk/Open-ILS/web/conify/global/actor/org_unit_type.html	2008-10-13 22:00:48 UTC (rev 10826)
+++ trunk/Open-ILS/web/conify/global/actor/org_unit_type.html	2008-10-14 02:39:13 UTC (rev 10827)
@@ -12,9 +12,16 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 -->
+
+<!DOCTYPE html PUBLIC 
+	"-//W3C//DTD XHTML 1.0 Transitional//EN" 
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+	<!--#include virtual="/opac/locale/${locale}/conify.dtd"-->
+]>
+
 <html xmlns="http://www.w3.org/1999/xhtml">
 	<head>
-		<title>Conify :: Global :: Actor :: Org Unit Types</title>
+		<title>&conify.org_unit_type.title;</title>
 
 		<style type="text/css">
 			@import url('/js/dojo/dojo/resources/dojo.css');
@@ -107,7 +114,7 @@
 				</script>
 				<div
 				  id="type_tree"
-				  label="Organization Types"
+				  label="&conify.org_unit_type.type_tree.label;"
 				  query="{'_top':'true'}"
 				  dojoType="dijit.Tree"
 				  store="ou_type_store"
@@ -182,7 +189,7 @@
 	
 						<table class="tundra" style="margin:10px;">
 							<tr>
-								<th>Type Name</th>
+								<th>&conify.org_unit_type.type_name;</th>
 								<td>
 									<span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true">
 										<script type="dojo/connect" event="onChange">
@@ -195,7 +202,7 @@
 								</td>
 							</tr>
 							<tr>
-								<th>OPAC Label</th>
+								<th>&conify.org_unit_type.opac_label;</th>
 								<td>
 									<span id="editor_pane_opac_label" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_opac_label" regExp=".+" required="true">
 										<script type="dojo/connect" event="onChange">
@@ -208,7 +215,7 @@
 								</td>
 							</tr>
 							<tr>
-								<th>Parent Type</th>
+								<th>&conify.org_unit_type.parent_type;</th>
 								<td>
 									<div
 									  id="editor_pane_parent"
@@ -239,7 +246,7 @@
 								</td>
 							</tr>
 							<tr>
-								<th>Can have Volumes/Copies</th>
+								<th>&conify.org_unit_type.can_have_volumes;</th>
 								<td>
 									<input
 									  id="editor_pane_can_have_vols"
@@ -251,7 +258,7 @@
 								</td>
 							</tr>
 							<tr>
-								<th>Can have Users</th>
+								<th>&conify.org_unit_type.can_have_users;</th>
 								<td>
 									<input
 									  id="editor_pane_can_have_users"
@@ -266,13 +273,13 @@
 	
 						<div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;">
 	
-							<button jsId="save_out_button" dojoType="dijit.form.Button" label="Save" onClick="save_type()">
+							<button jsId="save_out_button" dojoType="dijit.form.Button" label="&conify.org_unit_type.save_out_button.label;" onClick="save_type()">
 								<script type="dojo/connect" event="startup">
 									this.disabled = true;
 								</script>
 							</button>
 	
-							<button jsId="delete_out_button" dojoType="dijit.form.Button" label="Delete">
+							<button jsId="delete_out_button" dojoType="dijit.form.Button" label="&conify.org_unit_type.delete_out_button.label;">
 								<script type="dojo/connect" event="startup">
 									this.disabled = true;
 								</script>
@@ -359,7 +366,7 @@
 	
 						</div>
 	
-						<button jsId="new_kid_button" dojoType="dijit.form.Button" label="New Child">
+						<button jsId="new_kid_button" dojoType="dijit.form.Button" label="&conify.org_unit_type.new_kid_button.label;">
 							<script type="dojo/connect" event="startup">
 								this.disabled = true;
 							</script>

Modified: trunk/Open-ILS/web/conify/global/actor/org_unit_type.js
===================================================================
--- trunk/Open-ILS/web/conify/global/actor/org_unit_type.js	2008-10-13 22:00:48 UTC (rev 10826)
+++ trunk/Open-ILS/web/conify/global/actor/org_unit_type.js	2008-10-14 02:39:13 UTC (rev 10827)
@@ -33,6 +33,7 @@
 dojo.require('dijit.layout.SplitContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
+dojo.requireLocalization("openils.conify", "aout");
 
 // some handy globals
 var cgi = new CGI();
@@ -46,6 +47,8 @@
 
 var highlighter = {};
 
+var aout_strings = dojo.i18n.getLocalization('openils.conify', 'aout');
+
 function status_update (markup) {
 	if (parent !== window && parent.status_update) parent.status_update( markup );
 }
@@ -65,17 +68,17 @@
 		params : [ ses, modified_aout ],
 		onerror : function (r) {
 			highlighter.editor_pane.red.play();
-			status_update( 'Problem saving data for ' + ou_type_store.getValue( current_type, 'name' ) );
+			status_update( dojo.string.substitute(aout_strings.ERROR_SAVING_DATA, [ou_type_store.getValue( current_type, 'name' )] ) );
 		},
 		oncomplete : function (r) {
 			var res = r.recv();
 			if ( res && res.content() ) {
 				ou_type_store.setValue( current_type, 'ischanged', 0 );
 				highlighter.editor_pane.green.play();
-				status_update( 'Saved changes to ' + ou_type_store.getValue( current_type, 'name' ) );
+				status_update( dojo.string.substitute(aout_strings.SUCCESS_SAVING_DATA, [ou_type_store.getValue( current_type, 'name' )] ) );
 			} else {
 				highlighter.editor_pane.red.play();
-				status_update( 'Problem saving data for ' + ou_type_store.getValue( current_type, 'name' ) );
+				status_update( dojo.string.substitute(aout_strings.ERROR_SAVING_DATA, [ou_type_store.getValue( current_type, 'name' )] ) );
 			}
 		},
 	}).send();

Modified: trunk/Open-ILS/web/conify/global/admin.html
===================================================================
--- trunk/Open-ILS/web/conify/global/admin.html	2008-10-13 22:00:48 UTC (rev 10826)
+++ trunk/Open-ILS/web/conify/global/admin.html	2008-10-14 02:39:13 UTC (rev 10827)
@@ -12,9 +12,16 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 -->
+
+<!DOCTYPE html PUBLIC 
+	"-//W3C//DTD XHTML 1.0 Transitional//EN" 
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
+	<!--#include virtual="/opac/locale/${locale}/conify.dtd"-->
+]>
+
 <html xmlns="http://www.w3.org/1999/xhtml">
 	<head>
-		<title>Conify :: Global :: Admin</title>
+		<title>&conify.admin.title;</title>
 
         <style type="text/css">
             @import url('/js/dojo/dojo/resources/dojo.css');
@@ -52,24 +59,24 @@
 	</head>
 	<body class="tundra" id='pagebody'>
 		<div dojoType="dijit.layout.LayoutContainer" style="height: 100%; width: 100%; margin: 0; padding: 0; border: 0;">
-			<div id="top_pane" jsId="top_pane" dojoType="dijit.layout.ContentPane" layoutAlign="top" orientation="horizontal" style="margin: 4px; width: 100%; text-align: middle;" title="Controls">
+			<div id="top_pane" jsId="top_pane" dojoType="dijit.layout.ContentPane" layoutAlign="top" orientation="horizontal" style="margin: 4px; width: 100%; text-align: middle;" title="&conify.admin.top_pane.controls;">
 				<img src="/opac/images/small_logo.jpg"/>
-				<span style="font-size: large; padding-left: 20px;"> Configure your ILS </span>
+				<span style="font-size: large; padding-left: 20px;"> &conify.admin.configure; </span>
 			</div>
-			<div id="left_pane" jsId="left_pane" dojoType="dijit.layout.ContentPane" layoutAlign="left" orientation="vertical" style="height: 90%; margin: 4px;" label="Controls">
+			<div id="left_pane" jsId="left_pane" dojoType="dijit.layout.ContentPane" layoutAlign="left" orientation="vertical" style="height: 90%; margin: 4px;" label="&conify.admin.left_pane.controls;">
 				<ul style="margin-left: -10px;">
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'actor/org_unit_type.html'; return false;">Organization Types</a></li>
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'actor/org_unit.html'; return false;">Organizational Units</a></li>
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'permission/grp_tree.html'; return false;">Permission Groups</a></li>
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'permission/perm_list.html'; return false;">Permissions</a></li>
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'config/copy_status.html'; return false;">Copy Statuses</a></li>
-					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'config/marc_code_maps.html'; return false;">MARC Codes</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'actor/org_unit_type.html'; return false;">&conify.admin.org_unit_type.link;</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'actor/org_unit.html'; return false;">&conify.admin.org_unit.link;</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'permission/grp_tree.html'; return false;">&conify.admin.grp_tree.link;</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'permission/perm_list.html'; return false;">&conify.admin.perm_list.link;</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'config/copy_status.html'; return false;">&conify.admin.copy_status.link;</a></li>
+					<li><a href="javascript:void(0);" onclick="dojo.byId('action_iframe').src = 'config/marc_code_maps.html'; return false;">&conify.admin.marc_code_maps.link;</a></li>
 				</ul>
 			</div>
 			<div id="content_pane" jsId="content_pane" dojoType="dijit.layout.ContentPane" layoutAlign="client" style="margin: 2px; border-top: 2px solid grey; border-bottom: 2px solid grey; border-left: 2px solid grey;">
 				<iframe id="action_iframe" marginwidth="0" marginheight="0" style="border:0; height: 100%; width: 100%;"></iframe>
 			</div>
-			<div id="bottom_pane" jsId="bottom_pane" dojoType="dijit.layout.ContentPane" layoutAlign="bottom" orientation="horizontal" style="margin: 4px; height: 5%; width: 100%" title="Controls">
+			<div id="bottom_pane" jsId="bottom_pane" dojoType="dijit.layout.ContentPane" layoutAlign="bottom" orientation="horizontal" style="margin: 4px; height: 5%; width: 100%" title="">
 				<span id="status_text"/>
 			</div>
 		</div>

Added: trunk/Open-ILS/web/js/dojo/openils/conify/nls/aout.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/conify/nls/aout.js	                        (rev 0)
+++ trunk/Open-ILS/web/js/dojo/openils/conify/nls/aout.js	2008-10-14 02:39:13 UTC (rev 10827)
@@ -0,0 +1,4 @@
+{
+	ERROR_SAVING_DATA: "Problem saving data for ${0}",
+	SUCCESS_SAVING_DATA: "Saved changes to ${0}"
+}

Added: trunk/Open-ILS/web/opac/locale/en-US/conify.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/conify.dtd	                        (rev 0)
+++ trunk/Open-ILS/web/opac/locale/en-US/conify.dtd	2008-10-14 02:39:13 UTC (rev 10827)
@@ -0,0 +1,23 @@
+<!-- Main configuration interface menu -->
+<!ENTITY conify.admin.title "Global :: Administration">
+<!ENTITY conify.admin.top_pane.title "Controls">
+<!ENTITY conify.admin.configure "Configure your ILS">
+<!ENTITY conify.admin.left_pane.controls "Controls">
+<!ENTITY conify.admin.org_unit_type.link "Organization Types">
+<!ENTITY conify.admin.org_unit.link "Organizational Units">
+<!ENTITY conify.admin.grp_tree.link "Permission Groups">
+<!ENTITY conify.admin.perm_list.link "Permissions">
+<!ENTITY conify.admin.copy_status.link "Copy Statuses">
+<!ENTITY conify.admin.marc_code_maps.link "MARC Codes">
+<!ENTITY conify.admin.bottom_pane.title "Controls">
+<!-- Organization unit type configuration interface -->
+<!ENTITY conify.org_unit_type.title "Global :: Actor :: Organization Unit Types">
+<!ENTITY conify.org_unit_type.type_tree.label "Organization Unit Types">
+<!ENTITY conify.org_unit_type.type_name "Type Name">
+<!ENTITY conify.org_unit_type.opac_label "OPAC Label">
+<!ENTITY conify.org_unit_type.parent_type "Parent Type">
+<!ENTITY conify.org_unit_type.can_have_volumes "Can Have Volumes and Copies">
+<!ENTITY conify.org_unit_type.can_have_users "Can Have Users">
+<!ENTITY conify.org_unit_type.save_out_button.label "Save">
+<!ENTITY conify.org_unit_type.delete_out_button.label "Delete">
+<!ENTITY conify.org_unit_type.new_kid_button.label "New Child">



More information about the open-ils-commits mailing list