Patch Description: This patch i18n-izes the grp_tree.html and grp_tree.js files in conify.
Files changed are: - Open-ILS/web/conify/global/permission/grp_tree.html - Open-ILS/web/conify/global/permission/grp_tree.js - Open-ILS/web/opac/locale/en-US/conify.dtd Files added are: - Open-ILS/web/js/dojo/openils/conify/nls/pgt.js Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. Signed-off-by: Craig Ricciuto - [EMAIL PROTECTED]
=== modified file 'Open-ILS/web/conify/global/permission/grp_tree.html' --- Open-ILS/web/conify/global/permission/grp_tree.html 2008-10-08 05:19:39 +0000 +++ Open-ILS/web/conify/global/permission/grp_tree.html 2008-10-29 16:58:53 +0000 @@ -14,7 +14,7 @@ --> <html xmlns="http://www.w2.org/1999/xhtml"> <head> - <title>Conify :: Global :: Permission :: Group Tree</title> + <title>&conify.grp_tree.group_tree.title;</title> <style type="text/css"> @import url('/js/dojo/dojox/grid/_grid/tundraGrid.css'); @@ -82,7 +82,7 @@ method : 'open-ils.permacrud.search.pgt.atomic', timeout : 10, params : [ ses, { id : { "!=" : null } }, { order_by : { pgt : 'name' } } ], - onerror : function (r) { status_update('Problem fetching groups') }, + onerror : function (r) { status_update( pgt_strings.ERROR_FETCHING_GROUPS ) }, oncomplete : function (r) { window._group_list = r.recv().content(); window._group_data = pgt.toStoreData( window._group_list ); @@ -102,10 +102,7 @@ }); if (dirtyStore.length > 0) { - var confirmation = confirm( - 'There are unsaved modified Groups! '+ - 'OK to save these changes, Cancel to abandon them.' - ); + var confirmation = confirm( pgt_strings.CONFIRM EXIT ); if (confirmation) { for (var i in window.dirtyStore) { @@ -122,7 +119,7 @@ server.actor.request({ method : 'open-ils.actor.org_types.retrieve', timeout : 10, - onerror : function (r) { status_update('Problem fetching types') }, + onerror : function (r) { status_update( pgt_strings.ERROR_FETCHING_TYPES ) }, oncomplete : function (r) { window._ou_type_list = r.recv().content(); window._ou_type_data = aout.toStoreData( window._ou_type_list ); @@ -133,7 +130,7 @@ server.actor.request({ method : 'open-ils.actor.permissions.retrieve', timeout : 10, - onerror : function (r) { status_update('Problem fetching perms') }, + onerror : function (r) { status_update( pgt_strings.ERROR_FETCHING_PERMS ) }, oncomplete : function (r) { window._perm_list = r.recv().content(); @@ -152,7 +149,7 @@ method : 'open-ils.permacrud.search.pgpm.atomic', timeout : 10, params : [ ses, { id : { "!=" : null } } ], - onerror : function (r) { status_update('Problem fetching perm maps') }, + onerror : function (r) { status_update( pgt_strings.ERROR_FETCHING_PERM_MAPS ) }, oncomplete : function (r) { window._perm_map_list = r.recv().content(); window._perm_map_data = pgpm.toStoreData( window._perm_map_list, 'id' ); @@ -176,7 +173,7 @@ </script> <div id="group_tree" - label="Permission Groups" + label="&conify.grp_tree.permission_groups.label;" query="{'_top':'true'}" dojoType="dijit.Tree" store="group_store" @@ -196,7 +193,7 @@ perm_grid.refresh(); highlighter.editor_pane.green.play(); - status_update( 'Now editing ' + this.store.getValue( item, 'name' ) ); + status_update( dojo.string.substitute( pgt_strings.STATUS_EDITING, [this.store.getValue( item, 'name' )]) ); new_kid_button.disabled = false; save_group_button.disabled = false; @@ -246,7 +243,7 @@ </script> <div dojoType="dijit.layout.TabContainer"> - <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="Group Configuration"> + <div id="editor_pane" dojoType="dijit.layout.ContentPane" title="&conify.grp_tree.group_config.label;"> <script type="dojo/method"> highlighter.group_tree = {}; highlighter.editor_pane = {}; @@ -258,7 +255,7 @@ <table class="tundra" style="margin:10px;"> <tr> - <th>Group Name</th> + <th>&conify.grp_tree.group_name.label;</th> <td> <span id="editor_pane_name" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_name" regExp=".+" required="true"> <script type="dojo/connect" event="onChange"> @@ -271,7 +268,7 @@ </td> </tr> <tr> - <th>Description</th> + <th>&conify.grp_tree.description.label;</th> <td> <span> <textarea @@ -285,7 +282,7 @@ </td> </tr> <tr> - <th>Permission Interval</th> + <th>&conify.grp_tree.permission_interval.label;</th> <td> <span id="editor_pane_perm_interval" dojoType="dijit.form.ValidationTextBox" jsId="editor_pane_perm_interval" regExp="^\d+ (?:y.*|mo.*|d.*)$" required="true"> <script type="dojo/connect" event="onChange"> @@ -297,7 +294,7 @@ </td> </tr> <tr> - <th>Editing Permission</th> + <th>&conify.grp_tree.editing_permission.label;</th> <td> <div id="editor_pane_application_perm" @@ -317,7 +314,7 @@ </td> </tr> <tr> - <th>Parent Group</th> + <th>&conify.grp_tree.parent_group.label;</th> <td> <div id="editor_pane_parent" @@ -339,7 +336,7 @@ </td> </tr> <tr> - <th>User Group</th> + <th>&conify.grp_tree.user_group.label;</th> <td> <input id="editor_pane_usergroup" @@ -354,13 +351,13 @@ <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 20px;"> - <button jsId="save_group_button" dojoType="dijit.form.Button" label="Save" onClick="save_group()"> + <button jsId="save_group_button" dojoType="dijit.form.Button" label="&conify.grp_tree.save_button.label;" onClick="save_group()"> <script type="dojo/connect" event="startup"> this.disabled = true; </script> </button> - <button jsId="delete_group_button" dojoType="dijit.form.Button" label="Delete"> + <button jsId="delete_group_button" dojoType="dijit.form.Button" label="&conify.grp_tree.delete_button.label;"> <script type="dojo/connect" event="startup"> this.disabled = true; </script> @@ -369,7 +366,7 @@ if (group_store.getValue( current_group, '_trueRoot' ) == 'true') { highlighter.editor_pane.red.play(); - status_update( 'Cannot delete' + group_store.getValue( current_group, 'name' ) + ', you need at least one.' ); + status_update( dojo.string.substitute( pgt_strings.STATUS_ERR_DELETING, [group_store.getValue( current_group, 'name' )]) ); return false; } @@ -383,12 +380,12 @@ ); if ( existing_kids.length > 0) { highlighter.editor_pane.red.play(); - status_update( 'Cannot delete' + group_store.getValue( current_group, 'name' ) + ', ' + existing_kids.length + ' subordinates still exist.' ); + status_update( dojo.string.substitute( pgt_strings.STATUS_ERR_DELETING_DEPENDENCY, [group_store.getValue( current_group, 'name' ), existing_kids.length]) ); return; } } - if ( confirm('Are you sure you want to delete ' + current_group.name + '?')) { + if ( confirm( dojo.string.substitute( pgt_strings.CONFIRM_DELETE, [current_group.name]) ) ) { group_store.setValue( current_group, 'isdeleted', 1 ); var modified_pgt = new pgt().fromStoreItem( current_group ); @@ -400,7 +397,7 @@ params : [ ses, modified_pgt ], onerror : function (r) { highlighter.editor_pane.red.play(); - status_update( 'Problem deleting ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute( pgt_strings.CONFIRM_DELETE, [group_store.getValue( current_group, 'name' )]) ); }, oncomplete : function (r) { var res = r.recv(); @@ -431,10 +428,10 @@ window["editor_pane_usergroup"].setChecked( false ); // unset the value highlighter.editor_pane.green.play(); - status_update( old_name + ' deleted' ); + status_update( dojo.string.substitute( pgt_strings.STATUS_DELETED, [old_name]) ); } else { highlighter.editor_pane.red.play(); - status_update( 'Problem deleting ' + old_name ); + status_update( dojo.string.substitute( pgt_strings.ERROR_DELETING, [old_name]) ); } } }).send(); @@ -446,7 +443,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.grp_tree.new_child_button.label;"> <script type="dojo/connect" event="startup"> this.disabled = true; </script> @@ -467,7 +464,7 @@ params : [ ses, new_fm_obj ], onerror : function (r) { highlighter.editor_pane.red.play(); - status_update( 'Problem calling method to create child Group' ); + status_update( pgt_strings.ERROR_CALLING_METHOD ); err = true; }, oncomplete : function (r) { @@ -479,7 +476,7 @@ ); } else { highlighter.editor_pane.red.play(); - status_update( 'Problem creating child Group' ); + status_update( pgt_strings.ERROR_CREATING_CHILD_GROUP ); err = true; } }, @@ -488,7 +485,7 @@ if (!err) { highlighter.editor_pane.green.play(); highlighter.group_tree.green.play(); - status_update( 'New child Group created for ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute( pgt_strings.SUCCESS_NEW_CHILD_GROUP, [group_store.getValue( current_group, 'name' )]) ); } --> </script> @@ -496,7 +493,7 @@ </div> - <div id="perm_pane" dojoType="dijit.layout.ContentPane" title="Group Permissions"> + <div id="perm_pane" dojoType="dijit.layout.ContentPane" title="&conify.grp_tree.group_permissions.title;"> <script type="dojo/connect" event="onShow"> perm_map_model.query = { grp : current_group ? current_group.id[0] : -1 }; perm_map_model.refresh(); @@ -538,19 +535,19 @@ window.current_perm_grid_layout = [ { cells : [ [ - { name : "Code", + { name : pgt_strings.LABEL_CODE, field: "perm", formatter : dojo.partial(get_item_part, "perm", "id", "code", perm_map_model, perm_store), width : "auto" }, - { name : "Depth", + { name : pgt_strings.LABEL_DEPTH, field : "depth", formatter : dojo.partial(get_item_part, "depth", "depth", "name", perm_map_model, ou_type_store), editor : dojox.grid.editors.select, options : dojo.map( _ou_type_list, function (x) { return x.name() } ), values : dojo.map( _ou_type_list, function (x) { return x.depth() } ) }, - { name : "Grantable", + { name : pgt_strings.LABEL_GRANTABLE, field : "grantable", editor : dojox.grid.editors.bool, get : function (row) { @@ -573,11 +570,11 @@ <div id="new_perm_container" dojoType="dijit.layout.ContentPane" sizeShare="1" layoutAlign="client"> <div dojoType="dijit.form.DropDownButton" id="new_popup" jsId="new_popup"> - <span>New Mapping</span> + <span>&conify.grp_tree.new_mapping.label;</span> <div dojoType="dijit.TooltipDialog"> <table class="tundra"> <tr> - <td>Permission:</td> + <td>&conify.grp_tree.permission.label;</td> <td> <div dojoType="dijit.form.FilteringSelect" @@ -590,7 +587,7 @@ </td> </tr> <tr> - <td>Depth:</td> + <td>&conify.grp_tree.depth.label;</td> <td> <div dojoType="dijit.form.FilteringSelect" @@ -603,7 +600,7 @@ </td> </tr> <tr> - <td>Grantable:</td> + <td>&conify.grp_tree.grantable.label;</td> <td> <input type="checkbox" @@ -615,7 +612,7 @@ </tr> </table> - <button dojoType="dijit.form.Button" jsId="new_mapping_add" label="Add Mapping"> + <button dojoType="dijit.form.Button" jsId="new_mapping_add" label="&conify.grp_tree.add_mapping_button.label;"> <script type="dojo/connect" event="onClick"> <!-- var new_perm = new_perm_select.getValue(); @@ -649,7 +646,7 @@ params : [ ses, new_fm_obj ], onerror : function (r) { highlighter.group_tree.red.play(); - status_update( 'Problem calling method to create new Permission Map' ); + status_update( pgt_strings.ERROR_CALLING_METHOD_PERM_MAP ); err = true; }, oncomplete : function (r) { @@ -658,7 +655,7 @@ if ( res && res.content() ) { var new_item_hash = res.content().toHash(); perm_map_store.newItem( new_item_hash ); - status_update( 'New permission map created' ); + status_update( pgt_strings.SUCCESS_NEW_PERM_MAP ); highlighter.group_tree.green.play(); perm_map_model.query = { grp : current_group ? current_group.id[0] : -1 }; @@ -668,7 +665,7 @@ } else { highlighter.group_tree.red.play(); - status_update( 'Problem creating new Permission Map' ); + status_update( pgt_strings.ERROR_CREATING_PERM_MAP ); err = true; } } @@ -682,9 +679,9 @@ </div> </div> - <button jsId="save_pgpm_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button><br/> + <button jsId="save_pgpm_button" dojoType="dijit.form.Button" label="&conify.grp_tree.save_changes.label;" onClick="save_them_all()"></button><br/> - <button jsId="delete_pgpm_button" dojoType="dijit.form.Button" label="Remove Selected"> + <button jsId="delete_pgpm_button" dojoType="dijit.form.Button" label="&conify.grp_tree.remove_selected.label;"> <script type="dojo/connect" event="onClick"> <!-- var selected_rows = perm_grid.selection.getSelected(); @@ -712,7 +709,7 @@ params : [ ses, modified_pgpm ], onerror : function (r) { highlighter.editor_pane.red.play(); - status_update( 'Problem deleting permission mapping ' + perm_map_store.getValue( window.current_perm_map, 'id' ) ); + status_update( dojo.string.substitute( pgt_strings.ERROR_DELETING_PERM_MAPPING, [perm_map_store.getValue( window.current_perm_map, 'id' )] ) ); }, oncomplete : function (r) { var res = r.recv(); @@ -727,10 +724,10 @@ window.current_perm_map = null; highlighter.editor_pane.green.play(); - status_update( 'Permission mapping deleted' ); + status_update( pgt_strings.SUCCESS_DELETED_PERM_MAP ); } else { highlighter.editor_pane.red.play(); - status_update( 'Problem deleting permission mapping ' + perm_map_store.getValue( window.current_perm_map, 'id' )); + status_update( dojo.string.substitute( pgt_strings.ERROR_DELETING_PERM_MAPPING, [perm_map_store.getValue( window.current_perm_map, 'id' )]) ); } } }).send(); === modified file 'Open-ILS/web/conify/global/permission/grp_tree.js' --- Open-ILS/web/conify/global/permission/grp_tree.js 2008-10-16 15:36:04 +0000 +++ Open-ILS/web/conify/global/permission/grp_tree.js 2008-10-29 16:56:29 +0000 @@ -37,6 +37,7 @@ dojo.require('dojox.widget.Toaster'); dojo.require('dojox.fx'); dojo.require('dojox.grid.Grid'); +dojo.requireLocalization("openils.conify", "pgt"); // some handy globals var cgi = new CGI(); @@ -46,6 +47,8 @@ server.pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); server.actor = new OpenSRF.ClientSession('open-ils.actor'); +var pgt_strings = dojo.i18n.getLocalization('openils.conify', 'pgt'); + var current_group; var virgin_out_id = -1; @@ -70,17 +73,17 @@ params : [ ses, modified_pgt ], onerror : function (r) { highlighter.editor_pane.red.play(); - status_update( 'Problem saving data for ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute( pgt_strings.ERROR_SAVING_DATA, [group_store.getValue( current_group, 'name' )]) ); }, oncomplete : function (r) { var res = r.recv(); if ( res && res.content() ) { group_store.setValue( current_group, 'ischanged', 0 ); highlighter.editor_pane.green.play(); - status_update( 'Saved changes to ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute(pgt_strings.SUCCESS_SAVE, [group_store.getValue( current_group, 'name' )]) ); } else { highlighter.editor_pane.red.play(); - status_update( 'Problem saving data for ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute(pgt_strings.ERROR_SAVING_DATA, [group_store.getValue( current_group, 'name' )]) ); } }, }).send(); @@ -97,17 +100,17 @@ params : [ ses, modified_pgpm ], onerror : function (r) { highlighter.editor_pane.red.play(); - status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute(pgt_strings.ERROR_SAVING_PERM_DATA, [group_store.getValue( current_group, 'name' )]) ); }, oncomplete : function (r) { var res = r.recv(); if ( res && res.content() ) { perm_map_store.setValue( storeItem, 'ischanged', 0 ); highlighter.editor_pane.green.play(); - status_update( 'Saved permission changes to ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute(pgt_strings.SUCCESS_SAVE_PERM, [group_store.getValue( current_group, 'name' )]) ); } else { highlighter.editor_pane.red.play(); - status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + status_update( dojo.string.substitute(pgt_strings.ERROR_SAVING_PERM_DATA, [group_store.getValue( current_group, 'name' )]) ); } }, }).send(); @@ -127,10 +130,7 @@ if (event && dirtyMaps.length > 0) { - confirmation = confirm( - 'There are unsaved modified Permission Maps! '+ - 'OK to save these changes, Cancel to abandon them.' - ); + confirmation = confirm( pgt_strings.CONFIRM_EXIT); } if (confirmation) { === added file 'Open-ILS/web/js/dojo/openils/conify/nls/pgt.js' --- Open-ILS/web/js/dojo/openils/conify/nls/pgt.js 1970-01-01 00:00:00 +0000 +++ Open-ILS/web/js/dojo/openils/conify/nls/pgt.js 2008-10-29 16:56:37 +0000 @@ -0,0 +1,27 @@ +({ + "CONFIRM_DELETE": "Are you sure you want to delete ${0}?", + "CONFIRM_EXIT": "There are unsaved modified Permission Maps! OK to save these changes, Cancel to abandon them.", + "ERROR_CALLING_METHOD": "Problem calling method to create child Group", + "ERROR_CALLING_METHOD_PERM_MAP": "Problem calling method to create new Permission Map", + "ERROR_CREATING_CHILD_GROUP": "Problem creating child Group", + "ERROR_CREATING_PERMISSION": "Problem creating new Permission", + "ERROR_CREATING_PERM_MAP": "Problem creating new Permission Map", + "ERROR_DELETING": "Problem deleting ${0}", + "ERROR_DELETING_PERM_MAPPING": "Problem deleting permission mapping ${0}", + "ERROR_FETCHING_GROUPS": "Problem fetching groups", + "ERROR_FETCHING_PERMS": "Problem fetching perms", + "ERROR_FETCHING_PERM_MAPS": "Problem fetching perm maps", + "ERROR_FETCHING_TYPES": "Problem fetching types", + "ERROR_SAVING_DATA": "Problem saving data for ${0}", + "ERROR_SAVING_PERM_DATA": "Problem saving permission data for ${0}", + "LABEL_CODE ": "Code", + "LABEL_DEPTH": "Depth", + "LABEL_GRANTABLE": "Grantable", + "STATUS_DELETED": "${0} deleted", + "STATUS_EDITING": "Now editing ${0}", + "SUCCESS_DELETED_PERM_MAP": "Permission mapping deleted", + "SUCCESS_NEW_CHILD_GROUP": "New child Group created for ${0}", + "SUCCESS_NEW_PERM_MAP": "New permission map created", + "SUCCESS_SAVE": "Saved changes to ${0}", + "SUCCESS_SAVE_PERM": "Saved permission changes to ${0}" +}) === modified file 'Open-ILS/web/opac/locale/en-US/conify.dtd' --- Open-ILS/web/opac/locale/en-US/conify.dtd 2008-10-29 15:13:58 +0000 +++ Open-ILS/web/opac/locale/en-US/conify.dtd 2008-10-29 16:01:54 +0000 @@ -104,3 +104,26 @@ <!ENTITY conify.perm_list.add_button.label "Add"> <!ENTITY conify.perm_list.save_changes.label "Save Changes"> <!ENTITY conify.perm_list.delete_selected.label "Delete Selected"> + +<!-- grp_tree.html Entities --> +<!ENTITY conify.grp_tree.group_tree.title "Conify :: Global :: Permission :: Group Tree"> +<!ENTITY conify.grp_tree.permission_groups.label "Permission Groups"> +<!ENTITY conify.grp_tree.group_config.label "Group Configuration"> +<!ENTITY conify.grp_tree.group_name.label "Group Name"> +<!ENTITY conify.grp_tree.description.label "Description"> +<!ENTITY conify.grp_tree.permission_interval.label "Permission Interval"> +<!ENTITY conify.grp_tree.editing_permission.label "Editing Permission"> +<!ENTITY conify.grp_tree.parent_group.label "Parent Group"> +<!ENTITY conify.grp_tree.user_group.label "User Group"> +<!ENTITY conify.grp_tree.save_button.label "Save"> +<!ENTITY conify.grp_tree.delete_button.label "Delete"> +<!ENTITY conify.grp_tree.new_child_button.label "New Child"> +<!ENTITY conify.grp_tree.group_permissions.title "Group Permissions"> +<!ENTITY conify.grp_tree.new_mapping.label "New Mapping"> +<!ENTITY conify.grp_tree.permission.label "Permission:"> +<!ENTITY conify.grp_tree.depth.label "Depth:"> +<!ENTITY conify.grp_tree.grantable.label "Grantable:"> +<!ENTITY conify.grp_tree.add_mapping_button.label "Add Mapping"> +<!ENTITY conify.grp_tree.save_changes.label "Save Changes"> +<!-- To keep with the same theme throughout conify, shouldn't the following be "Delete Selected" instead? --> +<!ENTITY conify.grp_tree.remove_selected.label "Remove Selected">