[open-ils-commits] r9289 - 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 Apr 9 22:55:55 EDT 2008
Author: dbs
Date: 2008-04-09 22:18:34 -0400 (Wed, 09 Apr 2008)
New Revision: 9289
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
i18n for copy_notes.xul
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul 2008-04-10 02:17:26 UTC (rev 9288)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul 2008-04-10 02:18:34 UTC (rev 9289)
@@ -1,6 +1,9 @@
<?xml version="1.0"?>
<!-- Application: Evergreen Staff Client -->
<!-- Screen: Patron Display -->
+<!--
+ vim:noet:sw=4:ts=4
+-->
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- STYLESHEETS -->
@@ -12,7 +15,7 @@
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- LOCALIZATION -->
<!DOCTYPE window PUBLIC "" ""[
- <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
]>
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -37,7 +40,9 @@
function my_init() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
+ if (typeof JSAN == 'undefined') {
+ throw( $("commonStrings").getString('common.jsan.missing') );
+ }
JSAN.errorLevel = "die"; // none, warn, or die
JSAN.addRepository('/xul/server/');
@@ -53,8 +58,7 @@
refresh();
} catch(E) {
- var err_msg = "!! This software has encountered an error. Please tell your friendly " +
- "system administrator or software developer the following:\ncopy_notes.xul\n" + js2JSON(E) + '\n';
+ var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/copy_notes.xul', js2JSON(E)]);
try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
alert(err_msg);
}
@@ -86,8 +90,8 @@
var np = $('notes_panel');
var hbox = document.createElement('hbox'); np.appendChild(hbox);
var btn = document.createElement('button'); hbox.appendChild(btn);
- btn.setAttribute('label','Add New Note');
- btn.setAttribute('accesskey','A');
+ btn.setAttribute('label', $('catStrings').getString('staff.cat.copy_notes.render_notes.label'));
+ btn.setAttribute('accesskey', $('catStrings').getString('staff.cat.copy_notes.render_notes.accesskey'));
btn.setAttribute('oncommand','new_note()');
for (var i = 0; i < g.notes.length; i++) {
@@ -96,10 +100,18 @@
var node = $('note_template').cloneNode(true); np.appendChild(node); node.hidden = false;
apply(node,'create_date',g.notes[i].create_date().toString().substr(0,10));
util.widgets.apply(node,'name','create_date',
- function(n){n.setAttribute("tooltiptext","Note ID: " + g.notes[i].id() + " Creator ID: " + g.notes[i].creator());}
+ function(n) {
+ n.setAttribute(
+ "tooltiptext",
+ $('catStrings').getString('staff.cat.copy_notes.widgets_apply.note_id') + " "
+ + g.notes[i].id() + " "
+ + $('catStrings').getString('staff.cat.copy_notes.widgets_apply.creator_id') + " "
+ + g.notes[i].creator()
+ );
+ }
);
apply(node,'title',g.notes[i].title());
- apply(node,'pub',get_bool( g.notes[i].pub() ) ? "Public" : "Private");
+ apply(node,'pub',get_bool( g.notes[i].pub() ) ? $('catStrings').getString('staff.cat.copy_notes.widgets.public') : $('catStrings').getString('staff.cat.copy_notes.widgets.private'));
apply(node,'value',g.notes[i].value());
apply(node,'id',g.notes[i].id());
apply(node,'creator',g.notes[i].creator());
@@ -107,23 +119,33 @@
/* button bar */
var hb = document.createElement('hbox'); np.appendChild(hb);
var btn1 = document.createElement('button'); hb.appendChild(btn1);
- btn1.setAttribute('label','Delete This Note');
+ btn1.setAttribute('label', $('catStrings').getString('staff.cat.copy_notes.delete_note.label'));
btn1.setAttribute('image',"/xul/server/skin/media/images/up_arrow.gif");
btn1.addEventListener(
'command',
function(id){ return function() {
- var r = g.error.yns_alert('Delete the note titled "' + g.notes[id].title() + '" created on ' + g.notes[id].create_date().toString().substr(0,10) + '?','Delete Note','Yes','No',null,'Check here to confirm this action');
+ var r = g.error.yns_alert(
+ $('catStrings').getFormattedString('staff.cat.copy_notes.delete_note.prompt.msg', [g.notes[id].title(), g.notes[id].create_date().toString().substr(0,10)]),
+ $('catStrings').getString('staff.cat.copy_notes.delete_note.prompt.title'),
+ $('catStrings').getString('staff.cat.copy_notes.delete_note.prompt.yes'),
+ $('catStrings').getString('staff.cat.copy_notes.delete_note.prompt.no'),
+ null,
+ $('commonStrings').getString('common.confirm')
+ );
if (r == 0) {
g.network.simple_request('FM_ACPN_DELETE',[ses(),g.notes[id].id()]);
- setTimeout(function(){ alert('Note deleted.'); refresh();},0);
+ setTimeout(function() {
+ alert($('catStrings').getString('staff.cat.copy_notes.delete_note.success'));
+ refresh(); },0
+ );
}
} }(i),
false
);
var spacer = document.createElement('spacer'); hb.appendChild(spacer); spacer.flex = 1;
var btn2 = document.createElement('button'); hb.appendChild(btn2);
- btn2.setAttribute('label','Close Window');
+ btn2.setAttribute('label', $('catStrings').getString('staff.cat.copy_notes.delete_note.close_window'));
btn2.setAttribute('oncommand','window.close();');
}
@@ -132,7 +154,17 @@
function new_note() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
- var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1"><caption label="New Note"/><grid flex="1"><columns><column/><column flex="1"/></columns><rows><row><label value="Public?"/><checkbox id="pub" name="fancy_data" checked="false"/></row><row><label value="Title"/><textbox id="title" name="fancy_data"/></row><row><label value="Note"/><textbox multiline="true" id="note" name="fancy_data"/></row><row><spacer/><hbox><button label="Cancel" name="fancy_cancel" accesskey="C"/><button label="Add Note" accesskey="A" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
+ var xml = '<groupbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1">
+ <caption label="' + $('catStrings').getString('staff.cat.copy_notes.new_note.label') + '"/>
+ <grid flex="1"><columns><column/><column flex="1"/></columns>
+ <rows>
+ <row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.public') + '"/><checkbox id="pub" name="fancy_data" checked="false"/></row>
+ <row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.title') + '"/><textbox id="title" name="fancy_data"/></row>
+ <row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.note') + '"/><textbox multiline="true" id="note" name="fancy_data"/></row>
+ <row><spacer/><hbox>
+ <button label="' + $('catStrings').getString('staff.cat.copy_notes.new_note.cancel.label') + '" name="fancy_cancel" accesskey="' + $('catStrings').getString('staff.cat.copy_notes.new_note.cancel.accesskey') + '"/>
+ <button label="' + $('catStrings').getString('staff.cat.copy_notes.new_note.add_note.label') + '" accesskey="' + $('catStrings').getString('staff.cat.copy_notes.new_note.add_note.accesskey') + '" name="fancy_submit"/></hbox></row>
+ </rows></grid></groupbox>';
//g.data.init({'via':'stash'});
//g.data.temp_note_xml = xml; g.data.stash('temp_note_xml');
JSAN.use('util.window'); var win = new util.window();
@@ -155,10 +187,13 @@
note.owning_copy( g.copy_id );
var r = g.network.simple_request('FM_ACPN_CREATE',[ ses(), note ]);
if (typeof r.ilsevent != 'undefined') throw(r);
- setTimeout(function(){alert('Note added.');refresh();},0);
+ setTimeout(function() {
+ alert($('catStrings').getString('staff.cat.copy_notes.new_note.success'));
+ refresh();},0
+ );
}
} catch(E) {
- g.error.standard_unexpected_error_alert('The note was not likely created.',E);
+ g.error.standard_unexpected_error_alert($('catStrings').getString('staff.cat.copy_notes.new_note.error'),E);
}
}
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-04-10 02:17:26 UTC (rev 9288)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2008-04-10 02:18:34 UTC (rev 9289)
@@ -140,3 +140,26 @@
staff.cat.copy_editor.handle_update.error=copy update error:
staff.cat.copy_editor.add_stat_cat.error=Error adding statistical category to display definition
staff.cat.copy_editor.populate_stat_cat.error=Error populating statistical categories for display
+staff.cat.copy_notes.render_notes.label=Add New Note
+staff.cat.copy_notes.render_notes.accesskey=A
+staff.cat.copy_notes.widgets_apply.note_id=Note ID:
+staff.cat.copy_notes.widgets_apply.creator_id=Creator ID:
+staff.cat.copy_notes.widgets.public=Public
+staff.cat.copy_notes.widgets.private=Private
+staff.cat.copy_notes.delete_note.label=Delete This Note
+staff.cat.copy_notes.delete_note.prompt.msg=Delete the note titled "%1$s" created on %2$s?
+staff.cat.copy_notes.delete_note.prompt.title=Delete Note
+staff.cat.copy_notes.delete_note.prompt.yes=Yes
+staff.cat.copy_notes.delete_note.prompt.no=No
+staff.cat.copy_notes.delete_note.success=Note deleted.
+staff.cat.copy_notes.delete_note.close_window=Close Window
+staff.cat.copy_notes.new_note.label=New Note
+staff.cat.copy_notes.new_note.public=Public?
+staff.cat.copy_notes.new_note.title=Title
+staff.cat.copy_notes.new_note.note=Note
+staff.cat.copy_notes.new_note.cancel.label=Cancel
+staff.cat.copy_notes.new_note.cancel.accesskey=C
+staff.cat.copy_notes.new_note.add_note.label=Add Note
+staff.cat.copy_notes.new_note.add_note.accesskey=A
+staff.cat.copy_notes.new_note.success=Note added.
+staff.cat.copy_notes.new_note.error=The note was not likely created.
More information about the open-ils-commits
mailing list