Merge r10954 from trunk: Bring i18n to Conify copy status interface
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Oct 2008 02:34:04 +0000 (02:34 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 29 Oct 2008 02:34:04 +0000 (02:34 +0000)
Knocks another chunk off from #15

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

Open-ILS/web/conify/global/config/copy_status.html
Open-ILS/web/conify/global/config/copy_status.js
Open-ILS/web/js/dojo/openils/conify/nls/ccs.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/conify.dtd

index b01a07a..339718c 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 :: Config :: Copy Status</title>
+               <title>&conify.copy_status.title;</title>
 
                <style type="text/css">
                        @import url('/js/dojo/dojox/grid/_grid/tundraGrid.css');
@@ -74,7 +79,7 @@
                     method : 'open-ils.permacrud.search.ccs.atomic',
                     timeout : 10,
                     params : [ ses, { id : { "!=" : null } }, { order_by : { ccs : 'name' } } ],
-                    onerror : function (r) { status_update('Problem fetching statuses') },
+                    onerror : function (r) { status_update(ccs_strings.ERROR_FETCHING_STATUSES) },
                     oncomplete : function (r) {
 
                         window._status_list = r.recv().content();
 
                             if (dirtyStore.length > 0) {
                                 var confirmation = confirm(
-                                    'There are unsaved modified Statuses!  '+
-                                    'OK to save these changes, Cancel to abandon them.'
+                                                                       ccs_strings.CONFIRM_EXIT
                                 );
 
                                 if (confirmation) {
                        </script>
 
                        <div dojoType="dijit.layout.LayoutContainer" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
-                               <span>New Status:</span>
-                               <div dojoType="dijit.form.TextBox" id="new_status_code" jsId="new_status_name" label="New Status Name"></div>
-                               <button dojoType="dijit.form.Button" id="save_new_status_code" jsId="save_new_status_name" label="Add"> 
+                               <span>&conify.copy_status.new_status.label;</span>
+                               <div dojoType="dijit.form.TextBox" id="new_status_code" jsId="new_status_name" label="&conify.copy_status.new_status.name;"></div>
+                               <button dojoType="dijit.form.Button" id="save_new_status_code" jsId="save_new_status_name" label="&conify.copy_status.new_status.save;"> 
                                        <script type="dojo/connect" event="onClick">
 <!--
                                                var new_name = new_status_name.getValue();
                            params : [ ses, new_fm_obj ],
                                onerror : function (r) {
                                highlighter.red.play();
-                                   status_update( 'Problem calling method to create new Status' );
+                                   status_update( ccs_strings.ERROR_CALLING_METHOD );
                                err = true;
                                },
                                oncomplete : function (r) {
                                    if ( res && res.content() ) {
                                    var new_item_hash = res.content().toHash();
                                    status_store.newItem( new_item_hash );
-                                                                       status_update( 'New ' + new_item_hash.name + ' status created' );
+                                                                       status_update( dojo.string.substitute(ccs_strings.SUCCESS_CREATING_STATUS, [new_item_hash.name]) );
                                                                        status_grid.model.sort(-2);
                                                                        highlighter.green.play();
                                } else {
                                        highlighter.red.play();
-                                   status_update( 'Problem creating new Status' );
+                                   status_update( ccs_strings.ERROR_CREATING_STATUS );
                                        err = true;
                                }
                                }
                                                var status_grid_layout = [
                                                        {       cells : [
                                                                        [
-                                                                               { name : "ID",
+                                                                               { name : ccs_strings.ID,
                                                                                  field : "id",
                                                                                },
-                                                                               { name : "Name",
+                                                                               { name : ccs_strings.NAME,
                                                                                  field : "name",
                                                                                  width : "auto",
                                                                                  editor : dojox.grid.editors.Dijit
                                                                                },
-                                                                               { name : "Translation",
+                                                                               { name : ccs_strings.TRANSLATION,
                                                                                  width : "10em",
                                                                                  height : "2em",
                                                                                  get : function (row) {
                                                                                        return '';
                                                                                  }
                                                                                },
-                                                                               { name : "Holdable",
+                                                                               { name : ccs_strings.HOLDABLE,
                                                                                  field : "holdable",
                                                                                  editor : dojox.grid.editors.bool,
                                                                                  get : function (row) {
                                                                                        }
                                                                                  }
                                                                                },
-                                                                               { name : "OPAC Visible",
+                                                                               { name : ccs_strings.OPAC_VISIBLE,
                                                                                  field : "opac_visible",
                                                                                  editor : dojox.grid.editors.bool,
                                                                                  get : function (row) {
 
                        <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 5px;" layoutAlign="bottom">
                
-                               <button jsId="save_ccs_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+                               <button jsId="save_ccs_button" dojoType="dijit.form.Button" label="&conify.copy_status.save_changes;" onClick="save_them_all()"></button>
                
-                               <button jsId="delete_ccs_button" dojoType="dijit.form.Button" label="Delete Selected">
+                               <button jsId="delete_ccs_button" dojoType="dijit.form.Button" label="&conify.copy_status.delete_selected;">
                                        <script type="dojo/connect" event="onClick">
 <!--
                                                var selected_rows = status_grid.selection.getSelected();
                                                for (var i in selected_items) {
                                                        current_status = selected_items[i];
 
-                                                       if ( confirm('Are you sure you want to delete ' + status_store.getValue( current_status, 'name' ) + '?')) {
+                                                       if ( confirm(dojo.string.substitue(ccs_strings.CONFIRM_DELETE, [status_store.getValue( current_status, 'name' )]))) {
 
                                                                status_store.setValue( current_status, 'isdeleted', 1 );
                        
                                                                        params : [ ses, modified_ccs ],
                                                                        onerror : function (r) {
                                                                                highlighter.red.play();
-                                                                               status_update( 'Problem deleting ' + status_store.getValue( current_status, 'name' ) );
+                                                                               status_update( dojo.string.substitute( ccs_strings.ERROR_DELETING, [status_store.getValue( current_status, 'name' )] ) );
                                                                        },
                                                                        oncomplete : function (r) {
                                                                                var res = r.recv();
                                                                                        current_status = null;
                        
                                                                                        highlighter.green.play();
-                                                                                       status_update( old_name + ' deleted' );
+                                                                                       status_update( dojo.string.substitute(ccs_strings.STATUS_DELETED, [old_name]) );
                                                                                } else {
                                                                                        highlighter.red.play();
-                                                                                       status_update( 'Problem deleting ' + old_name );
+                                                                                       status_update( dojo.string.substitute(ccs_strings.ERROR_DELETING, [old_name]) );
                                                                                }
                                                                        }
                                                                }).send();
index 758dbc4..6eb9f66 100644 (file)
@@ -29,6 +29,7 @@ dojo.require('dijit.layout.BorderContainer');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('dojox.grid.Grid');
+dojo.requireLocalization("openils.conify", "ccs");
 
 // some handy globals
 var cgi = new CGI();
@@ -39,6 +40,8 @@ var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud');
 var current_status;
 var virgin_out_id = -1;
 
+var ccs_strings = dojo.i18n.getLocalization('openils.conify', 'ccs');
+
 var highlighter = {};
 
 function status_update (markup) {
@@ -56,17 +59,17 @@ function save_status () {
                params : [ ses, modified_ccs ],
                onerror : function (r) {
                        highlighter.red.play();
-                       status_update( 'Problem saving ' + status_store.getValue( current_status, 'name' ) );
+                       status_update( dojo.string.substitute(ccs_strings.ERROR_SAVING_STATUS, [status_store.getValue( current_status, 'name' )]) );
                },
                oncomplete : function (r) {
                        var res = r.recv();
                        if ( res && res.content() ) {
                                status_store.setValue( current_status, 'ischanged', 0 );
                                highlighter.green.play();
-                               status_update( 'Saved changes to ' + status_store.getValue( current_status, 'name' ) );
+                               status_update( dojo.string.substitute(ccs_strings.SUCCESS_SAVE, [status_store.getValue( current_status, 'name' )]) );
                        } else {
                                highlighter.red.play();
-                               status_update( 'Problem saving ' + status_store.getValue( current_status, 'name' ) );
+                               status_update( dojo.string.substitute(ccs_strings.ERROR_SAVING_STATUS, [status_store.getValue( current_status, 'name' )]) );
                        }
                },
        }).send();
@@ -85,8 +88,7 @@ function save_them_all (event) {
 
        if (event && dirtyStore.length > 0) {
                confirmation = confirm(
-                       'There are unsaved modified Statuses!  '+
-                       'OK to save these changes, Cancel to abandon them.'
+                       ccs_strings.CONFIRM_EXIT
                );
        }
 
diff --git a/Open-ILS/web/js/dojo/openils/conify/nls/ccs.js b/Open-ILS/web/js/dojo/openils/conify/nls/ccs.js
new file mode 100644 (file)
index 0000000..c53f9ce
--- /dev/null
@@ -0,0 +1,17 @@
+{
+       "CONFIRM_DELETE": "Are you sure you want to delete ${0}?",
+       "CONFIRM_EXIT": "There are unsaved changes to one or more copy statuses. Click OK to save these changes, or Cancel to abandon them.",
+       "ERROR_CALLING_METHOD": "Problem calling method to create new copy status",
+       "ERROR_CREATING_STATUS": "Problem creating new Status",
+       "ERROR_DELETING": "Problem deleting ${0}",
+       "ERROR_FETCHING_STATUSES": "Problem fetching statuses",
+       "ERROR_SAVING_STATUS": "Problem saving ${0}",
+       "HOLDABLE": "Holdable",
+       "ID": "ID",
+       "NAME": "Name",
+       "OPAC_VISIBLE": "OPAC Visible",
+       "STATUS_DELETED": "${0} deleted", 
+       "SUCCESS_CREATING_STATUS": "New ${0} status created",
+       "SUCCESS_SAVE": "Saved changes to ${0}",
+       "TRANSLATION": "Translation",
+}
index d9f8ea1..e5550e1 100644 (file)
 <!ENTITY conify.org_unit.addresses_pane.county "County">
 <!-- This is a highlighted label that is followed by the name of the organizational unit -->
 <!ENTITY conify.org_unit.status_bar "Now editing:">
+
+<!ENTITY conify.copy_status.title "Global :: Configuration :: Copy Status">
+<!ENTITY conify.copy_status.new_status.label "New Status:">
+<!ENTITY conify.copy_status.new_status.name "New Status Name">
+<!ENTITY conify.copy_status.new_status.save "Add">
+<!ENTITY conify.copy_status.save_changes "Save Changes">
+<!ENTITY conify.copy_status.delete_selected "Delete Selected">