Start making it possible to localize Conify.
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Oct 2008 02:39:13 +0000 (02:39 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Oct 2008 02:39:13 +0000 (02:39 +0000)
Using a combination of mod_xmlent and dojo string substitution for the nonce.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@10827 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/conify/global/actor/org_unit_type.html
Open-ILS/web/conify/global/actor/org_unit_type.js
Open-ILS/web/conify/global/admin.html
Open-ILS/web/js/dojo/openils/conify/nls/aout.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/conify.dtd [new file with mode: 0644]

index fa86865..01b793a 100644 (file)
 # 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');
                                </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"
        
                                                <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">
                                                                </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">
                                                                </td>
                                                        </tr>
                                                        <tr>
-                                                               <th>Parent Type</th>
+                                                               <th>&conify.org_unit_type.parent_type;</th>
                                                                <td>
                                                                        <div
                                                                          id="editor_pane_parent"
                                                                </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"
                                                                </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"
        
                                                <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>
        
                                                </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>
index d9cd7cb..0e71a1c 100644 (file)
@@ -33,6 +33,7 @@ dojo.require('dijit.layout.LayoutContainer');
 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 virgin_out_id = -1;
 
 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 @@ function save_type () {
                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();
index d2fecf9..8e2f5e5 100644 (file)
 # 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');
        </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>
diff --git a/Open-ILS/web/js/dojo/openils/conify/nls/aout.js b/Open-ILS/web/js/dojo/openils/conify/nls/aout.js
new file mode 100644 (file)
index 0000000..cd7e663
--- /dev/null
@@ -0,0 +1,4 @@
+{
+       ERROR_SAVING_DATA: "Problem saving data for ${0}",
+       SUCCESS_SAVING_DATA: "Saved changes to ${0}"
+}
diff --git a/Open-ILS/web/opac/locale/en-US/conify.dtd b/Open-ILS/web/opac/locale/en-US/conify.dtd
new file mode 100644 (file)
index 0000000..61feaef
--- /dev/null
@@ -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">