[open-ils-commits] r9650 - in
trunk/Open-ILS/xul/staff_client/server: cat locale/en-US
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed May 21 00:23:04 EDT 2008
Author: dbs
Date: 2008-05-21 00:23:02 -0400 (Wed, 21 May 2008)
New Revision: 9650
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
Log:
i18n patch from Craig Ricciuto:
Changes for record_buckets.xul:
- converted hard-coded strings in the JavaScript to be stored in the DTD.
- No XML strings to change.
Changes for record_buckets.js:
- Removed trailing commas in places
- Converted all hard-coded strings to use JavaScript from the .properties file(s)
Changes for cat.properties:
- Added the property string names/values from record_buckets.js/.xul
Changes for common.properties:
- Added a common string that appear multiple times in record_buckets.js to here.
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2008-05-21 03:42:34 UTC (rev 9649)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2008-05-21 04:23:02 UTC (rev 9650)
@@ -1,5 +1,7 @@
dump('entering cat.record_buckets.js\n');
+function $(id) { return document.getElementById(id); }
+
if (typeof cat == 'undefined') cat = {};
cat.record_buckets = function (params) {
@@ -18,7 +20,7 @@
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance( nsIFilePicker );
- fp.init( window, "Save File As", nsIFilePicker.modeSave );
+ fp.init( window, $("catStrings").getString('staff.cat.record_buckets.save_file_as'), nsIFilePicker.modeSave );
if (defaultFileName)
fp.defaultString = defaultFileName;
@@ -60,11 +62,11 @@
if (file) {
persist.saveURI(uri,null,null,null,null,file);
} else {
- alert("File not downloaded.");
+ alert( $("catStrings").getString('staff.cat.record_buckets.export_records.alert') );
}
} catch(E) {
- obj.error.standard_unexpected_error_alert('Records could not be exported.',E);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.export_records.std_unexpected_error'), E);
}
};
@@ -79,7 +81,7 @@
if (this.first_pause) {
this.first_pause = false;
} else {
- alert("Action completed.");
+ alert( $("commonStrings").getString('common.action_complete'));
}
var obj = this;
obj.list1.clear();
@@ -104,7 +106,7 @@
'publisher' : { 'hidden' : false },
'pubdate' : { 'hidden' : false },
'isbn' : { 'hidden' : false },
- 'tcn' : { 'hidden' : false },
+ 'tcn' : { 'hidden' : false }
}
);
@@ -122,7 +124,8 @@
if (typeof params.on_retrieve == 'function') { params.on_retrieve(row); }
} catch(E) {
- obj.error.standard_unexpected_error_alert('Error retrieving mvr for record with id =' + row.my.docid, E);
+ obj.error.standard_unexpected_error_alert(
+ $("catStrings").getFormattedString('staff.cat.record_buckets.retrieve_row.std_unexpected_error', [row.my.docid]), E);
}
}
);
@@ -156,7 +159,7 @@
} catch(E) {
alert('FIXME: ' + E);
}
- },
+ }
}
);
@@ -185,7 +188,7 @@
} catch(E) {
alert('FIXME: ' + E);
}
- },
+ }
}
);
@@ -218,7 +221,7 @@
} catch(E) {
alert('FIXME: ' + E);
}
- },
+ }
}
);
@@ -273,10 +276,13 @@
[ ses(), obj.data.list.au[0].id() ]
);
if (typeof buckets.ilsevent != 'undefined') {
- obj.error.standard_unexpected_error_alert('Could not retrieve your buckets.',buckets);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.buckets.std_unexpected_error'), buckets);
return;
}
- var items = [ ['Choose a bucket...',''], ['Retrieve shared bucket...',-1] ].concat(
+ var items = [
+ [$("catStrings").getString('staff.cat.record_buckets.menulist_placeholder.item1'),''],
+ [$("catStrings").getString('staff.cat.record_buckets.menulist_placeholder.item2'),-1]
+ ].concat(
util.functional.map_list(
util.functional.filter_list(
buckets.biblio,
@@ -308,7 +314,7 @@
function change_bucket(ev) {
var bucket_id = ev.target.value;
if (bucket_id < 0 ) {
- bucket_id = window.prompt('Enter bucket number:');
+ bucket_id = window.prompt($("catStrings").getString('staff.cat.record_buckets.change_bucket.bucket_id'));
ev.target.value = bucket_id;
ev.target.setAttribute('value',bucket_id);
}
@@ -332,7 +338,7 @@
if (bucket.ilsevent == 1506 /* CONTAINER_NOT_FOUND */) {
alert('Could not find a bucket with ID = ' + bucket_id);
} else {
- obj.error.standard_unexpected_error_alert('Error retrieving bucket. Did you use a valid bucket id?',bucket);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.change_bucket.error'),bucket);
}
return;
}
@@ -505,7 +511,7 @@
alert(js2JSON(E));
}
}
- alert("Action completed.");
+ alert( $("commonStrings").getString('common.action_complete'));
setTimeout(
function() {
JSAN.use('util.widgets');
@@ -525,7 +531,7 @@
obj.list2.clear();
var robj = obj.network.simple_request('BUCKET_DELETE',[ses(),'biblio',bucket]);
if (typeof robj == 'object') throw robj;
- alert("Action completed.");
+ alert( $("commonStrings").getString('common.action_complete'));
var x = document.getElementById('info_box');
x.setAttribute('hidden','true');
obj.controller.view.cmd_record_buckets_delete_bucket.setAttribute('disabled','true');
@@ -544,7 +550,7 @@
);
} catch(E) {
- alert('FIXME -- ' + E);
+ alert('FIXME: ' + E);
}
}
],
@@ -552,7 +558,11 @@
['command'],
function() {
try {
- var name = prompt('What would you like to name the bucket?','','Bucket Creation');
+ var name = prompt(
+ $("catStrings").getString('staff.cat.record_buckets.new_bucket.bucket_prompt'),
+ '',
+ $("catStrings").getString('staff.cat.record_buckets.new_bucket.bucket_prompt_title')
+ );
if (name) {
var bucket = new cbreb();
@@ -564,15 +574,14 @@
if (typeof robj == 'object') {
if (robj.ilsevent == 1710 /* CONTAINER_EXISTS */) {
- alert('You already have a bucket with that name.');
+ alert($("catStrings").getString('staff.cat.record_buckets.new_bucket.same_name_alert'));
return;
}
throw robj;
}
+ alert($("catStrings").getFormattedString('staff.cat.record_buckets.new_bucket.bucket_created', [name]));
- alert('Bucket "' + name + '" created.');
-
obj.controller.render('record_buckets_menulist_placeholder');
obj.controller.view.bucket_menulist.value = robj;
setTimeout(
@@ -635,16 +644,21 @@
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
var top_xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" >';
- top_xml += '<description>Merge these records? (Select the "lead" record first)</description>';
- top_xml += '<hbox><button id="lead" disabled="true" label="Merge" name="fancy_submit"/><button label="Cancel" accesskey="C" name="fancy_cancel"/></hbox></vbox>';
+ top_xml += '<description>' + $("catStrings").getString('staff.cat.record_buckets.merge_records.merge_lead') + '</description>';
+ top_xml += '<hbox>';
+ top_xml += '<button id="lead" disabled="true" label="'
+ + $("catStrings").getString('staff.cat.record_buckets.merge_records.button.label') + '" name="fancy_submit"/>';
+ top_xml += '<button label="' + $("catStrings").getString('staff.cat.record_buckets.merge_records.cancel_button.label') +'" accesskey="'
+ + $("catStrings").getString('staff.cat.record_buckets.merge_records.cancel_button.accesskey') +'" name="fancy_cancel"/></hbox></vbox>';
var xml = '<form xmlns="http://www.w3.org/1999/xhtml">';
xml += '<table><tr valign="top">';
for (var i = 0; i < record_ids.length; i++) {
- xml += '<td><input value="Lead" id="record_' + record_ids[i] + '" type="radio" name="lead"';
- xml += ' onclick="' + "try { var x = document.getElementById('lead'); x.setAttribute('value',";
+ xml += '<td><input value="' + $("catStrings").getString('staff.cat.record_buckets.merge_records.lead')
+ + ' id="record_' + record_ids[i] + '" type="radio" name="lead"';
+ xml += ' onclick="' + "try { var x = $('lead'); x.setAttribute('value',";
xml += record_ids[i] + '); x.disabled = false; } catch(E) { alert(E); }">';
- xml += '</input>Lead Record? #' + record_ids[i] + '</td>';
+ xml += '</input>' + $("catStrings").getFormattedString('staff.cat.record_buckets.merge_records.lead_record_number',[record_ids[i]]) + '</td>';
}
xml += '</tr><tr valign="top">';
for (var i = 0; i < record_ids.length; i++) {
@@ -667,12 +681,15 @@
//+ '&title=' + window.escape('Record Merging'),
'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
{
- 'top_xml' : top_xml, 'xml' : xml, 'title' : 'Record Merging'
+ 'top_xml' : top_xml, 'xml' : xml, 'title' : $("catStrings").getString('staff.cat.record_buckets.merge_records.fancy_prompt_title')
}
);
//obj.data.stash_retrieve();
- if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status == 'incomplete') { alert('Merge Aborted'); return; }
+ if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status == 'incomplete') {
+ alert($("catStrings").getString('staff.cat.record_buckets.merge_records.fancy_prompt.alert'));
+ return;
+ }
var robj = obj.network.simple_request('MERGE_RECORDS',
[
ses(),
@@ -687,7 +704,7 @@
if (typeof robj.ilsevent != 'undefined') {
throw(robj);
} else {
- alert('Records were successfully merged.');
+ alert($("catStrings").getString('staff.cat.record_buckets.merge_records.success'));
}
obj.render_pending_records(); // FIXME -- need a generic refresh for lists
@@ -698,7 +715,7 @@
}, 0
);
} catch(E) {
- obj.error.standard_unexpected_error_alert('Records were not likely merged.',E);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.merge_records.catch.std_unex_error'),E);
}
}
@@ -721,13 +738,19 @@
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
var top_xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" >';
- top_xml += '<description>Delete these records?</description>';
- top_xml += '<hbox><button id="lead" disabled="false" label="Delete" name="fancy_submit"/><button label="Cancel" accesskey="C" name="fancy_cancel"/></hbox></vbox>';
+ top_xml += '<description>' + $("catStrings").getString('staff.cat.record_buckets.delete_records.xml1') + '</description>';
+ top_xml += '<hbox>';
+ top_xml += '<button id="lead" disabled="false" label="'
+ + $("catStrings").getString('staff.cat.record_buckets.delete_records.button.label')
+ + '" name="fancy_submit"/>';
+ top_xml += '<button label="'
+ + $("catStrings").getString('staff.cat.record_buckets.delete_records.cancel_button.label') +'" accesskey="'
+ + $("catStrings").getString('staff.cat.record_buckets.delete_records.cancel_button.accesskey') +'" name="fancy_cancel"/></hbox></vbox>';
var xml = '<form xmlns="http://www.w3.org/1999/xhtml">';
xml += '<table><tr valign="top">';
for (var i = 0; i < record_ids.length; i++) {
- xml += '<td>Record #' + record_ids[i] + '</td>';
+ xml += '<td>' + $("catStrings").getFormattedString('staff.cat.record_buckets.delete_records.xml2', [record_ids[i]]) + '</td>';
}
xml += '</tr><tr valign="top">';
for (var i = 0; i < record_ids.length; i++) {
@@ -750,20 +773,23 @@
//+ '&title=' + window.escape('Record Purging'),
'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
{
- 'top_xml' : top_xml, 'xml' : xml, 'title' : 'Record Purging'
+ 'top_xml' : top_xml, 'xml' : xml, 'title' : $("catStrings").getString('staff.cat.record_buckets.delete_records.fancy_prompt_title')
}
);
//obj.data.stash_retrieve();
- if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status != 'complete') { alert('Delete Aborted'); return; }
+ if (typeof fancy_prompt_data.fancy_status == 'undefined' || fancy_prompt_data.fancy_status != 'complete') {
+ alert($("catStrings").getString('staff.cat.record_buckets.delete_records.fancy_prompt.alert'));
+ return;
+ }
var s = '';
for (var i = 0; i < record_ids.length; i++) {
var robj = obj.network.simple_request('FM_BRE_DELETE',[ses(),record_ids[i]]);
if (typeof robj.ilsevent != 'undefined') {
- if (!s) s = 'Error deleting these records:\n';
- s += 'Record #' + record_ids[i] + ' : ' + robj.textcode + ' : ' + robj.desc + '\n';
+ if (!s) s = $("catStrings").getString('staff.cat.record_buckets.delete_records.s1');
+ s += $("catStrings").getFormattedString('staff.cat.record_buckets.delete_records.s2', [record_ids[i], robj.textcode, robj.desc]);
}
}
- if (s) { alert(s); } else { alert('Records deleted.'); }
+ if (s) { alert(s); } else { alert($("catStrings").getString('staff.cat.record_buckets.delete_records.delete_success.alert')); }
obj.render_pending_records(); // FIXME -- need a generic refresh for lists
setTimeout(
@@ -773,7 +799,7 @@
}, 0
);
} catch(E) {
- obj.error.standard_unexpected_error_alert('Records were not likely deleted.',E);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.delete_records.catch.std_unex_err',E));
}
}
@@ -781,7 +807,7 @@
'cmd_broken' : [
['command'],
- function() { alert('Not Yet Implemented'); }
+ function() { alert($("catStrings").getString('staff.cat.record_buckets.cmd_broken.alert')); }
],
'cmd_sel_opac' : [
['command'],
@@ -803,16 +829,16 @@
var content_params = {
'session' : ses(),
'authtime' : ses('authtime'),
- 'opac_url' : opac_url,
+ 'opac_url' : opac_url
};
xulG.new_tab(
xulG.url_prefix(urls.XUL_OPAC_WRAPPER),
- {'tab_name':'Retrieving title...'},
+ {'tab_name':$("catStrings").getString('staff.cat.record_buckets.cmd_sel_opac.tab_name')},
content_params
);
}
} catch(E) {
- obj.error.standard_unexpected_error_alert('Showing in OPAC',E);
+ obj.error.standard_unexpected_error_alert($("catStrings").getString('staff.cat.record_buckets.cmd_sel_opac.catch.std_unex_err'),E);
}
}
],
@@ -840,7 +866,7 @@
obj.list0.clear();
var y = document.getElementById('query_status');
x.disabled = true;
- if (y) y.value = 'Searching...';
+ if (y) y.value = $("catStrings").getString('staff.cat.record_buckets.submit.query_status');
obj.network.simple_request(
'FM_BRE_ID_SEARCH_VIA_MULTICLASS_QUERY',
[ {}, x.value, 1 ],
@@ -895,10 +921,10 @@
};
return item;
} catch(E) {
- obj.error.standard_unexpected_error_alert('Could not retrieve this record: ' + docid,E);
+ obj.error.standard_unexpected_error_alert($("catStrings").getFormattedString('staff.cat.record_buckets.prep_record_for_list.std_unex_err', [docid]),E);
return null;
}
- },
+ }
};
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2008-05-21 03:42:34 UTC (rev 9649)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2008-05-21 04:23:02 UTC (rev 9650)
@@ -12,7 +12,7 @@
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- LOCALIZATION -->
<!DOCTYPE window PUBLIC "" ""[
- <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
]>
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -41,9 +41,9 @@
/* ugly hack so we don't have to upgrade the chrome for quick buckets */
if (typeof xulG == 'undefined') location.href = String(location.href).replace(/record_buckets.xul/,'record_buckets_quick.xul');
- catStrings = document.getElementById('catStrings');
+ catStrings = document.getElementById('catStrings');
+ if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
- if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
JSAN.errorLevel = "die"; // none, warn, or die
JSAN.addRepository('/xul/server/');
JSAN.use('util.error'); g.error = new util.error();
@@ -72,9 +72,7 @@
}
} catch(E) {
- var err_msg = "!! This software has encountered an error. Please tell your friendly " +
- "system administrator or software developer the following:\n"
- + 'cat.record_buckets.xul\n' + E + '\n';
+ var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/record_buckets.xul', E]);
try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
alert(err_msg);
}
@@ -85,6 +83,7 @@
<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
<messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale' -->/cat.properties"/>
+ <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
<commandset id="record_buckets_cmds">
<command id="sel_clip0" disabled="true"/>
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2008-05-21 03:42:34 UTC (rev 9649)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2008-05-21 04:23:02 UTC (rev 9650)
@@ -196,3 +196,43 @@
staff.cat.opac.set_marc_edit.alert=Record successfully saved.
staff.cat.opac.set_marc_edit.std_unexpected_error=Record not likely updated.
staff.cat.opac.refresh.function_not_implemented.alert=Not yet implemented. Work around: Choose Duplicate in New Tab option
+staff.cat.record_buckets.save_file_as=Save File As
+staff.cat.record_buckets.export_records.alert=File not downloaded.
+staff.cat.record_buckets.export_records.std_unexpected_error=Records could not be exported.
+staff.cat.record_buckets.rednder_pending_records.alert=Action completed.
+staff.cat.record_buckets.retrieve_row.std_unexpected_error=Error retrieving mvr for record with ID = %1$s
+staff.cat.record_buckets.buckets.std_unexpected_error=Could not retrieve your buckets.
+staff.cat.record_buckets.menulist_placeholder.item1=Choose a bucket...
+staff.cat.record_buckets.menulist_placeholder.item2=Retrieve shared bucket...
+staff.cat.record_buckets.change_bucket.bucket_id=Enter bucket number:
+staff.cat.record_buckets.change_bucket.error=Error retrieving bucket. Did you use a valid bucket ID?
+staff.cat.record_buckets.new_bucket.bucket_prompt=What would you like to name the bucket?
+staff.cat.record_buckets.new_bucket.bucket_prompt_title=Bucket Creation
+staff.cat.record_buckets.new_bucket.same_name_alert=You already have a bucket with that name.
+staff.cat.record_buckets.new_bucket.bucket_created=Bucket %1$s created.
+staff.cat.record_buckets.merge_records.merge_lead=Merge these records? (Select the "lead" record first)
+staff.cat.record_buckets.merge_records.button.label=Merge
+staff.cat.record_buckets.merge_records.cancel_button.label=Cancel
+staff.cat.record_buckets.merge_records.cancel_button.accesskey=C
+staff.cat.record_buckets.merge_records.lead_record_number=Lead Record? # %1$s
+staff.cat.record_buckets.merge_records.lead=Lead
+staff.cat.record_buckets.merge_records.fancy_prompt_title=Record Merging
+staff.cat.record_buckets.merge_records.fancy_prompt.alert=Merge Aborted
+staff.cat.record_buckets.merge_records.success=Records were successfully merged.
+staff.cat.record_buckets.merge_records.catch.std_unex_error=Records were not likely merged.
+staff.cat.record_buckets.delete_records.xml1=Delete these records?
+staff.cat.record_buckets.delete_records.button.label=Delete
+staff.cat.record_buckets.delete_records.cancel_button.label=Cancel
+staff.cat.record_buckets.delete_records.cancel_button.accesskey=C
+staff.cat.record_buckets.delete_records.xml2=Record? # %1$s
+staff.cat.record_buckets.delete_records.fancy_prompt_title=Record Purging
+staff.cat.record_buckets.delete_records.fancy_prompt.alert=Delete Aborted
+staff.cat.record_buckets.delete_records.s1=Error deleting these records:\n
+staff.cat.record_buckets.delete_records.s2=Record #%1$s : %2$s : %3$s\n
+staff.cat.record_buckets.delete_records.delete_success.alert=Records deleted.
+staff.cat.record_buckets.delete_records.catch.std_unex_err=Records were not likely deleted.
+staff.cat.record_buckets.cmd_broken.alert=Not Yet Implemented
+staff.cat.record_buckets.cmd_sel_opac.tab_name=Retrieving title...
+staff.cat.record_buckets.cmd_sel_opac.catch.std_unex_err=Showing in OPAC
+staff.cat.record_buckets.submit.query_status=Searching...
+staff.cat.record_buckets.prep_record_for_list.std_unex_err=Could not retrieve this record: %1$s
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2008-05-21 03:42:34 UTC (rev 9649)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2008-05-21 04:23:02 UTC (rev 9650)
@@ -12,6 +12,7 @@
common.barcode.status.warning.blocked=Blocked
common.barcode.status.warning.unknown=with an unknown code: %1$s
common.date.invalid=Invalid Date
+common.action_complete=Action completed.
# common.grouping_string = the string that should be inserted between elements of a grouped list
common.grouping_string=,
common.unimplemented=Not yet implemented
More information about the open-ils-commits
mailing list