[open-ils-commits] r10974 - in branches/rel_1_4: Open-ILS/web/conify/global/permission Open-ILS/web/js/dojo/openils/conify/nls Open-ILS/web/opac/locale/en-US build/i18n
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Oct 29 12:40:17 EDT 2008
Author: dbs
Date: 2008-10-29 12:40:09 -0400 (Wed, 29 Oct 2008)
New Revision: 10974
Added:
branches/rel_1_4/Open-ILS/web/js/dojo/openils/conify/nls/pgt.js
Modified:
branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.html
branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.js
branches/rel_1_4/Open-ILS/web/opac/locale/en-US/conify.dtd
branches/rel_1_4/build/i18n/Makefile
Log:
Merge r10970, r10973 from trunk:
* Craig Ricciuto's patch (with some modifications) for making the Conify perm_list interface internationalized
Modified: branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.html
===================================================================
--- branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.html 2008-10-29 16:35:54 UTC (rev 10973)
+++ branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.html 2008-10-29 16:40:09 UTC (rev 10974)
@@ -12,9 +12,14 @@
# 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 :: Permission :: Permission List</title>
+ <title>&conify.perm_list.permission_list.title;</title>
<style type="text/css">
@import url('/js/dojo/dojox/grid/_grid/tundraGrid.css');
@@ -73,7 +78,7 @@
method : 'open-ils.permacrud.search.ppl.atomic',
timeout : 10,
params : [ ses, { id : { "!=" : null } }, { order_by : { ppl : 'code' } } ],
- 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();
@@ -89,11 +94,11 @@
window.perm_grid_layout = [
{ cells : [
[
- { name : "Code", field : "code", width : "300px", editor : dojox.grid.editors.Dijit, rowSpan : "2" },
- { name : "Description", field : "description", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" }
+ { name : pgt_strings.LABEL_CODE, field : "code", width : "300px", editor : dojox.grid.editors.Dijit, rowSpan : "2" },
+ { name : pgt_strings.LABEL_DESCRIPTION, field : "description", width : "auto", editor : dojox.grid.editors.Editor, style : "minHeight:1em;" }
],
[
- { name : "Translation",
+ { name : pgt_strings.LABEL_TRANSLATION,
width : "10em",
height : "2em",
get : function (row) {
@@ -129,10 +134,7 @@
});
if (dirtyStore.length > 0) {
- var confirmation = confirm(
- 'There are unsaved modified Permissions! '+
- 'OK to save these changes, Cancel to abandon them.'
- );
+ var confirmation = confirm(pgt_strings.CONFIRM_EXIT);
if (confirmation) {
for (var i in window.dirtyStore) {
@@ -149,9 +151,9 @@
</script>
<div dojoType="dijit.layout.LayoutContainer" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
- <span>New Permission:</span>
- <div dojoType="dijit.form.TextBox" id="new_perm_code" jsId="new_perm_code" label="New Code"></div>
- <button dojoType="dijit.form.Button" id="save_new_perm_code" jsId="save_new_perm_code" label="Add">
+ <span>&conify.perm_list.new_permission.label;</span>
+ <div dojoType="dijit.form.TextBox" id="new_perm_code" jsId="new_perm_code" label="&conify.perm_list.new_code.label;"></div>
+ <button dojoType="dijit.form.Button" id="save_new_perm_code" jsId="save_new_perm_code" label="&conify.perm_list.add.label;">
<script type="dojo/connect" event="onClick">
<!--
var new_code = new_perm_code.getValue();
@@ -169,7 +171,7 @@
params : [ ses, new_fm_obj ],
onerror : function (r) {
highlighter.red.play();
- status_update( 'Problem calling method to create new Permission' );
+ status_update( pgt_strings.ERROR_CALLING_METHOD );
err = true;
},
oncomplete : function (r) {
@@ -177,12 +179,12 @@
if ( res && res.content() ) {
var new_item_hash = res.content().toHash();
perm_store.newItem( new_item_hash );
- status_update( 'New ' + new_item_hash.code + ' permission created' );
+ status_update( dojo.string.substitute(pgt_strings.SUCCESS_CREATING_PERMISSION, [new_item_hash.code]) );
perm_grid.model.sort(-1);
highlighter.green.play();
} else {
highlighter.red.play();
- status_update( 'Problem creating new Permission' );
+ status_update( pgt_strings.ERROR_CREATING_PERMISSION );
err = true;
}
}
@@ -204,9 +206,9 @@
<div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 5px;" layoutAlign="bottom">
- <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="Save Changes" onClick="save_them_all()"></button>
+ <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.save_changes.label;" onClick="save_them_all()"></button>
- <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="Delete Selected">
+ <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.delete_selected.label;">
<script type="dojo/connect" event="onClick">
<!--
var selected_rows = perm_grid.selection.getSelected();
@@ -223,7 +225,7 @@
for (var i in selected_items) {
current_perm = selected_items[i];
- if ( confirm('Are you sure you want to delete ' + perm_store.getValue( current_perm, 'code' ) + '?')) {
+ if ( confirm( dojo.string.substitute(pgt_strings.CONFIRM_DELETE, [perm_store.getValue(current_perm, 'code')]) ) ) {
perm_store.setValue( current_perm, 'isdeleted', 1 );
@@ -236,7 +238,7 @@
params : [ ses, modified_ppl ],
onerror : function (r) {
highlighter.red.play();
- status_update( 'Problem deleting ' + perm_store.getValue( current_perm, 'code' ) );
+ status_update( dojo.string.substitute(pgt_strings.ERROR_DELETING, [perm_store.getValue( current_perm, 'code' )]) );
},
oncomplete : function (r) {
var res = r.recv();
@@ -253,10 +255,10 @@
current_perm = null;
highlighter.green.play();
- status_update( old_name + ' deleted' );
+ status_update( dojo.string.substitute(pgt_strings.STATUS_DELETED, [old_name]) );
} else {
highlighter.red.play();
- status_update( 'Problem deleting ' + old_name );
+ status_update( dojo.string.substitute(pgt_strings.ERROR_DELETING, [old_name]) );
}
}
}).send();
Modified: branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.js
===================================================================
--- branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.js 2008-10-29 16:35:54 UTC (rev 10973)
+++ branches/rel_1_4/Open-ILS/web/conify/global/permission/perm_list.js 2008-10-29 16:40:09 UTC (rev 10974)
@@ -29,6 +29,7 @@
dojo.require('dojox.widget.Toaster');
dojo.require('dojox.fx');
dojo.require('dojox.grid.Grid');
+dojo.requireLocalization("openils.config", "pgt");
// some handy globals
var cgi = new CGI();
@@ -36,6 +37,8 @@
var ses = cookieManager.read('ses') || cgi.param('ses');
var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud');
+var pgt_strings = dojo.i18n.getLocalization('openils.conify', 'pgt');
+
var current_perm;
var virgin_out_id = -1;
@@ -58,17 +61,17 @@
params : [ ses, modified_ppl ],
onerror : function (r) {
highlighter.red.play();
- status_update( 'Problem saving data for ' + perm_store.getValue( current_perm, 'code' ) );
+ status_update( dojo.string.substitute(pgt_strings.ERROR_SAVING_DATA, [perm_store.getValue(current_perm, 'code')]) );
},
oncomplete : function (r) {
var res = r.recv();
if ( res && res.content() ) {
perm_store.setValue( current_perm, 'ischanged', 0 );
highlighter.green.play();
- status_update( 'Saved changes to ' + perm_store.getValue( current_perm, 'code' ) );
+ status_update( dojo.string.substitute(pgt_strings.SUCCESS_SAVE, [perm_store.getValue(current_perm, 'code')]) );
} else {
highlighter.red.play();
- status_update( 'Problem saving data for ' + perm_store.getValue( current_perm, 'code' ) );
+ status_update( dojo.string.substitute(pgt_strings.ERROR_SAVING_DATA, [perm_store.getValue(current_perm, 'code')]) );
}
},
}).send();
@@ -86,10 +89,7 @@
if (event && dirtyStore.length > 0) {
- confirmation = confirm(
- 'There are unsaved modified Permissions! '+
- 'OK to save these changes, Cancel to abandon them.'
- );
+ confirmation = confirm( pgt_strings.CONFIRM_EXIT );
}
if (confirmation) {
Copied: branches/rel_1_4/Open-ILS/web/js/dojo/openils/conify/nls/pgt.js (from rev 10970, trunk/Open-ILS/web/js/dojo/openils/conify/nls/pgt.js)
===================================================================
--- branches/rel_1_4/Open-ILS/web/js/dojo/openils/conify/nls/pgt.js (rev 0)
+++ branches/rel_1_4/Open-ILS/web/js/dojo/openils/conify/nls/pgt.js 2008-10-29 16:40:09 UTC (rev 10974)
@@ -0,0 +1,15 @@
+({
+ "CONFIRM_DELETE": "Are you sure you want to delete ${0}?",
+ "CONFIRM_EXIT": "There are unsaved modified Permissions! OK to save these changes, Cancel to abandon them.",
+ "ERROR_CALLING_METHOD": "Problem calling method to create new Permission",
+ "ERROR_CREATING_PERMISSION": "Problem creating new Permission",
+ "ERROR_DELETING": "Problem deleting ${0}",
+ "ERROR_FETCHING_PERMS": "Problem fetching perms",
+ "ERROR_SAVING_DATA": "Problem saving data for ${0}",
+ "LABEL_CODE": "Code",
+ "LABEL_DESCRIPTION": "Description",
+ "LABEL_TRANSLATION": "Translation",
+ "STATUS_DELETED": "${0} deleted",
+ "SUCCESS_CREATING_PERMISSION": "New ${0} permission created",
+ "SUCCESS_SAVE": "Saved changes to ${0}"
+})
Modified: branches/rel_1_4/Open-ILS/web/opac/locale/en-US/conify.dtd
===================================================================
--- branches/rel_1_4/Open-ILS/web/opac/locale/en-US/conify.dtd 2008-10-29 16:35:54 UTC (rev 10973)
+++ branches/rel_1_4/Open-ILS/web/opac/locale/en-US/conify.dtd 2008-10-29 16:40:09 UTC (rev 10974)
@@ -97,3 +97,11 @@
<!ENTITY conify.marc_code_maps.video.title "Videorecording Format Map">
<!ENTITY conify.marc_code_maps.video.new.label "New Video Recording Format:">
+
+<!-- perm_list.html Entities -->
+<!ENTITY conify.perm_list.permission_list.title "Conify :: Global :: Permission :: Permission List">
+<!ENTITY conify.perm_list.new_code.label "New Code">
+<!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">
+<!ENTITY conify.perm_list.new_permission.label "New Permission:">
Modified: branches/rel_1_4/build/i18n/Makefile
===================================================================
--- branches/rel_1_4/build/i18n/Makefile 2008-10-29 16:35:54 UTC (rev 10973)
+++ branches/rel_1_4/build/i18n/Makefile 2008-10-29 16:40:09 UTC (rev 10974)
@@ -85,12 +85,14 @@
@scripts/dojo_resource.py --pot $(DOJOSRC)/aout.js --output $(POTSRC)/conify.aout.pot
@scripts/dojo_resource.py --pot $(DOJOSRC)/cam.js --output $(POTSRC)/conify.cam.pot
@scripts/dojo_resource.py --pot $(DOJOSRC)/ccs.js --output $(POTSRC)/conify.ccs.pot
+ @scripts/dojo_resource.py --pot $(DOJOSRC)/pgt.js --output $(POTSRC)/conify.pgt.pot
po2dojo:
@scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.aou.po --output $(PROJECT)/$(LOCALE)/conify.aou.js
@scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.aout.po --output $(PROJECT)/$(LOCALE)/conify.aout.js
@scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.cam.po --output $(PROJECT)/$(LOCALE)/conify.cam.js
@scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.ccs.po --output $(PROJECT)/$(LOCALE)/conify.ccs.js
+ @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.pgt.po --output $(PROJECT)/$(LOCALE)/conify.pgt.js
ils2pot:
@scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
@@ -154,3 +156,4 @@
cp $(PROJECT)/$(LOCALE)/conify.aout.js $(DOJOSRC)/$(DOJO_LOCALE)/aout.js
cp $(PROJECT)/$(LOCALE)/conify.cam.js $(DOJOSRC)/$(DOJO_LOCALE)/cam.js
cp $(PROJECT)/$(LOCALE)/conify.ccs.js $(DOJOSRC)/$(DOJO_LOCALE)/ccs.js
+ cp $(PROJECT)/$(LOCALE)/conify.pgt.js $(DOJOSRC)/$(DOJO_LOCALE)/pgt.js
More information about the open-ils-commits
mailing list