Localize checkin and checkout interfaces
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Jan 2008 20:51:34 +0000 (20:51 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Jan 2008 20:51:34 +0000 (20:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@8498 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/circ/checkin.xul
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/checkout.xul
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index a95d94a..86bced1 100644 (file)
 <!ENTITY staff.server.admin.stat_cat.update_success "Update succeeded">
 <!ENTITY staff.server.admin.upload_xacts.title "Upload Offline Transactions">
 <!ENTITY staff.server.admin.upload_xacts.header "Uploading transactions...">
+<!ENTITY staff.circ.checkin_overlay.sel_clip.label "Copy to Clipboard">
+<!ENTITY staff.circ.checkin_overlay.sel_clip.accesskey "C">
+<!ENTITY staff.circ.checkin_overlay.sel_bucket.label "Add to Item Bucket">
+<!ENTITY staff.circ.checkin_overlay.sel_bucket.accesskey "A">
+<!ENTITY staff.circ.checkin_overlay.sel_opac.label "Show in Catalog">
+<!ENTITY staff.circ.checkin_overlay.sel_opac.accesskey "S">
+<!ENTITY staff.circ.checkin_overlay.sel_copy_details.label "Show Item Details">
+<!ENTITY staff.circ.checkin_overlay.sel_copy_details.accesskey "I">
+<!ENTITY staff.circ.checkin_overlay.sel_patron.label "Show Last Few Circulations">
+<!ENTITY staff.circ.checkin_overlay.sel_patron.accesskey "L">
+<!ENTITY staff.circ.checkin_overlay.sel_last_patron.label "Retrieve Last Patron who circulated item">
+<!ENTITY staff.circ.checkin_overlay.sel_last_patron.accesskey "R">
+<!ENTITY staff.circ.checkin_overlay.sel_edit.label "Edit Item Attributes">
+<!ENTITY staff.circ.checkin_overlay.sel_edit.accesskey "E">
+<!ENTITY staff.circ.checkin_overlay.sel_mark_items_damaged.label "Mark Item Damaged">
+<!ENTITY staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey "D">
+<!ENTITY staff.circ.checkin_overlay.sel_transit_abort.label "Abort Transit">
+<!ENTITY staff.circ.checkin_overlay.sel_spine.label "Print Spine Label">
+<!ENTITY staff.circ.checkin_overlay.sel_spine.accesskey "P">
+<!ENTITY staff.circ.checkin_overlay.save_columns.label "Save Columns">
+<!ENTITY staff.circ.checkin_overlay.background_text "Check In / Process Item">
+<!ENTITY staff.circ.checkin_overlay.background_text.hold_capture "Auto-Print Hold and Transit Slips">
+<!ENTITY staff.circ.checkin_overlay.effective_date.label "Effective Date:">
+<!ENTITY staff.circ.checkin_overlay.actions.label "Actions for Selected Items">
+<!ENTITY staff.circ.checkin_overlay.actions.accesskey "S">
+<!ENTITY staff.circ.checkin_overlay.checkin_export.label "Export">
+<!ENTITY staff.circ.checkin_overlay.trim_list.label "Trim List (20 rows)">
+<!ENTITY staff.circ.checkin_overlay.strict_barcode.label "Strict Barcode">
+<!ENTITY staff.circ.checkin_overlay.do_not_alert_on_precat.label "Ignore Pre-cataloged Items">
+<!ENTITY staff.circ.checkin_overlay.checkin_auto.label "Auto-Print Hold and Transit Slips">
+<!ENTITY staff.circ.checkin_overlay.checkin_auto.accesskey "P">
index 13c7de7..ee1554c 100644 (file)
@@ -12,7 +12,7 @@
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- LOCALIZATION -->
 <!DOCTYPE window PUBLIC "" ""[
-       <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
+       <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
 ]>
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -35,7 +35,7 @@
                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( document.getElementById("commonStrings").getString('common.jsan.missing') ); }
                                JSAN.errorLevel = "die"; // none, warn, or die
                                JSAN.addRepository('/xul/server/');
                                JSAN.use('util.error'); g.error = new util.error();
@@ -64,9 +64,7 @@
                                }
 
                        } catch(E) {
-                               var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
-                                       "system administrator or software developer the following:\n" 
-                                       + 'circ.checkin.xul\n' + E + '\n';
+                               var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['circ.checkin.xul', E]);
                                try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
                                alert(err_msg);
                        }
@@ -76,7 +74,7 @@
        ]]>
        </script>
 
-    <messagecatalog id="circStrings" src="/xul/server/locale/<!-- #echo var='locale'-->/circ.properties"/>
+       <messagecatalog id="circStrings" src="/xul/server/locale/<!-- #echo var='locale'-->/circ.properties"/>
 
        <popupset id="copy_status_popupset"/>
 
index ceb3bb8..39d8715 100644 (file)
@@ -1,7 +1,10 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- LOCALIZATION -->
 <!DOCTYPE overlay PUBLIC "" ""[
-       <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
+       <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
 ]>
+
 <overlay id="checkin_overlay" 
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 
 <popupset id="copy_status_popupset">
        <popup id="copy_status_actions" position="at_pointer"> 
-               <menuitem command="sel_clip" label="Copy to Clipboard" accesskey="C" />
-               <menuitem command="sel_bucket" label="Add to Item Bucket" accesskey="A"/>
-               <menuitem command="sel_opac" label="Show in Catalog" accesskey="S" />
-               <menuitem command="sel_copy_details" label="Show Item Details" accesskey="I" />
-               <menuitem command="sel_patron" label="Show Last Few Circulations" accesskey="L"/>
-               <menuitem command="sel_last_patron" label="Retrieve Last Patron who circulated item" accesskey="R"/>
+               <menuitem command="sel_clip" label="&staff.circ.checkin_overlay.sel_clip.label;" accesskey="&staff.circ.checkin_overlay.sel_clip.accesskey;" />
+               <menuitem command="sel_bucket" label="&staff.circ.checkin_overlay.sel_bucket.label;" accesskey="&staff.circ.checkin_overlay.sel_bucket.accesskey;"/>
+               <menuitem command="sel_opac" label="&staff.circ.checkin_overlay.sel_opac.label;" accesskey="&staff.circ.checkin_overlay.sel_opac.accesskey;" />
+               <menuitem command="sel_copy_details" label="&staff.circ.checkin_overlay.sel_copy_details.label;" accesskey="&staff.circ.checkin_overlay.sel_copy_details.accesskey;" />
+               <menuitem command="sel_patron" label="&staff.circ.checkin_overlay.sel_patron.label;" accesskey="&staff.circ.checkin_overlay.sel_patron.accesskey;"/>
+               <menuitem command="sel_last_patron" label="&staff.circ.checkin_overlay.sel_last_patron.label;" accesskey="&staff.circ.checkin_overlay.sel_last_patron.accesskey;"/>
                <menuseparator/>
-               <menuitem command="sel_edit" label="Edit Item Attributes" accesskey="E" />
+               <menuitem command="sel_edit" label="&staff.circ.checkin_overlay.sel_edit.label;" accesskey="&staff.circ.checkin_overlay.sel_edit.accesskey;" />
                <menuseparator />
-               <menuitem command="sel_mark_items_damaged" label="Mark Item Damaged" accesskey="D"/>
+               <menuitem command="sel_mark_items_damaged" label="&staff.circ.checkin_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey;"/>
                <menuseparator />
-               <menuitem command="sel_transit_abort" label="Abort Transit" />
+               <menuitem command="sel_transit_abort" label="&staff.circ.checkin_overlay.sel_transit_abort.label;" />
                <menuseparator />
-               <menuitem command="sel_spine" label="Print Spine Label" accesskey="P"/>
-               <menuitem command="save_columns" label="Save Columns"/>
+               <menuitem command="sel_spine" label="&staff.circ.checkin_overlay.sel_spine.label;" accesskey="&staff.circ.checkin_overlay.sel_spine.accesskey;"/>
+               <menuitem command="save_columns" label="&staff.circ.checkin_overlay.save_columns.label;"/>
        </popup>
 </popupset>
 
@@ -37,8 +40,8 @@
        <hbox id="background" style="background-color: green;">
                <spacer flex="1"/>
                <vbox>
-                       <label id="background-text" value="Check In / Process Item" style="font-size: x-large; font-weight: bold;"/>
-                       <label id="hold_capture_blurb" hidden="true" value="(and Auto-Print Hold/Transit Slips)" style="font-size: large; font-weight: bold;"/>
+                       <label id="background-text" value="&staff.circ.checkin_overlay.background_text;" style="font-size: x-large; font-weight: bold;"/>
+                       <label id="hold_capture_blurb" hidden="true" value="&staff.circ.checkin_overlay.background_text.hold_capture;" style="font-size: large; font-weight: bold;"/>
                </vbox>
                <spacer flex="1"/>
        </hbox>
        <vbox>
                <hbox>
                        <hbox id="checkin_effective_date_hbox">
-                               <label id="checkin_effective_date_label" value="Effective Date:" control="checkin_effective_date_textbox" accesskey="D"/>
+                               <label id="checkin_effective_date_label" value="&staff.circ.checkin_overlay.effective_date.label;" control="checkin_effective_date_textbox" accesskey="D"/>
                                <textbox id="checkin_effective_date_textbox"/>
                        </hbox>
                        <menubar>
-                       <menu label="Actions for Selected Items" accesskey="S">
+                       <menu label="&staff.circ.checkin_overlay.actions.label;" accesskey="&staff.circ.checkin_overlay.actions.accesskey;">
                                <menupopup>
-                                       <menuitem command="sel_clip" label="Copy to Clipboard" accesskey="C" />
-                                       <menuitem command="sel_bucket" label="Add to Item Bucket" accesskey="A"/>
-                                       <menuitem command="sel_opac" label="Show in Catalog" accesskey="S" />
-                                       <menuitem command="sel_copy_details" label="Show Item Details" accesskey="I" />
-                                       <menuitem command="sel_patron" label="Show Last Few Circulations" accesskey="L"/>
-                                       <menuitem command="sel_last_patron" label="Retrieve Last Patron who circulated item" accesskey="R"/>
-                                       <menuseparator />
-                                       <menuitem command="sel_edit" label="Edit Item Attributes" accesskey="E" />
+                                       <menuitem command="sel_clip" label="&staff.circ.checkin_overlay.sel_clip.label;" accesskey="&staff.circ.checkin_overlay.sel_clip.accesskey;" />
+                                       <menuitem command="sel_bucket" label="&staff.circ.checkin_overlay.sel_bucket.label;" accesskey="&staff.circ.checkin_overlay.sel_bucket.accesskey;"/>
+                                       <menuitem command="sel_opac" label="&staff.circ.checkin_overlay.sel_opac.label;" accesskey="&staff.circ.checkin_overlay.sel_opac.accesskey;" />
+                                       <menuitem command="sel_copy_details" label="&staff.circ.checkin_overlay.sel_copy_details.label;" accesskey="&staff.circ.checkin_overlay.sel_copy_details.accesskey;" />
+                                       <menuitem command="sel_patron" label="&staff.circ.checkin_overlay.sel_patron.label;" accesskey="&staff.circ.checkin_overlay.sel_patron.accesskey;"/>
+                                       <menuitem command="sel_last_patron" label="&staff.circ.checkin_overlay.sel_last_patron.label;" accesskey="&staff.circ.checkin_overlay.sel_last_patron.accesskey;"/>
+                                       <menuseparator/>
+                                       <menuitem command="sel_edit" label="&staff.circ.checkin_overlay.sel_edit.label;" accesskey="&staff.circ.checkin_overlay.sel_edit.accesskey;" />
                                        <menuseparator />
-                                       <menuitem command="sel_mark_items_damaged" label="Mark Item Damaged" accesskey="D"/>
+                                       <menuitem command="sel_mark_items_damaged" label="&staff.circ.checkin_overlay.sel_mark_items_damaged.label;" accesskey="&staff.circ.checkin_overlay.sel_mark_items_damaged.accesskey;"/>
                                        <menuseparator />
-                                       <menuitem command="sel_transit_abort" label="Abort Transit" />
+                                       <menuitem command="sel_transit_abort" label="&staff.circ.checkin_overlay.sel_transit_abort.label;" />
                                        <menuseparator />
-                                       <menuitem command="sel_spine" label="Print Spine Label" accesskey="P"/>
-                                       <menuitem command="save_columns" label="Save Columns"/>
+                                       <menuitem command="sel_spine" label="&staff.circ.checkin_overlay.sel_spine.label;" accesskey="&staff.circ.checkin_overlay.sel_spine.accesskey;"/>
+                                       <menuitem command="save_columns" label="&staff.circ.checkin_overlay.save_columns.label;"/>
                                </menupopup>
                        </menu>
                        </menubar>
                command="cmd_checkin_print"
                accesskey="&staff.checkin.print_receipt_label.accesskey;"/>
        <button id="checkin_export" 
-               label="Export"
+               label="&staff.circ.checkin_overlay.checkin_export.label;"
                command="cmd_checkin_export"
                accesskey=""/>
-       <checkbox id="trim_list" label="Trim List (20 rows)" checked="true" persist="checked"/> 
-       <checkbox id="strict_barcode" label="Strict Barcode" checked="false" persist="checked"/> 
-       <checkbox id="do_not_alert_on_precat" label="Don't Alert on Pre-Cat" persist="checked"/> 
+       <checkbox id="trim_list" label="&staff.circ.checkin_overlay.trim_list.label;" checked="true" persist="checked"/> 
+       <checkbox id="strict_barcode" label="&staff.circ.checkin_overlay.strict_barcode.label;" checked="false" persist="checked"/> 
+       <checkbox id="do_not_alert_on_precat" label="&staff.circ.checkin_overlay.do_not_alert_on_precat.label;" persist="checked"/> 
        <spacer id="pcii3s" flex="1"/>
-       <checkbox id="checkin_auto" label="Auto-Print for Hold/Transit Slips" accesskey="P" persist="checked"/> 
+       <checkbox id="checkin_auto" label="&staff.circ.checkin_overlay.checkin_auto.label;" accesskey="&staff.circ.checkin_overlay.checkin_auto.accesskey;" persist="checked"/> 
 </hbox>
 
 </overlay>
index 6753f3c..788fb9b 100644 (file)
@@ -68,7 +68,7 @@ circ.checkout.prototype = {
                                                                                                                [ b.owning_lib(), b.name() ]
                                                                                                        );
                                                                                                } catch(E) {
-                                                                                                       alert('error in noncat sorting: ' + E);
+                                                                                                       alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkout.sorting.exception', [E]));
                                                                                                        return 0;
                                                                                                }
                                                                                        }
@@ -124,7 +124,7 @@ circ.checkout.prototype = {
                                                                ev.target.parentNode.setAttribute('style','');
                                                        } catch(E) {
                                                                ev.target.parentNode.setAttribute('style','background-color: red');
-                                                               alert(E + '\nUse this format: YYYY-MM-DD');
+                                                               alert(E + '\n' + document.getElementById('circStrings').getString('staff.circ.checkout.date.exception'));
                                                                try {
                                                                        ev.target.inputField.select();
                                                                        ev.target.inputField.focus();
@@ -136,7 +136,7 @@ circ.checkout.prototype = {
                                        ],
                                        'cmd_broken' : [
                                                ['command'],
-                                               function() { alert('Not Yet Implemented'); }
+                                               function() { alert(document.getElementById('circStrings').getString('staff.circ.checkout.unimplemented')); }
                                        ],
                                        'cmd_checkout_submit' : [
                                                ['command'],
@@ -150,19 +150,44 @@ circ.checkout.prototype = {
                                                                params.noncat = 1;
                                                                params.noncat_type = obj.controller.view.checkout_menu.value;
                                                                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
-                                                               var r = window.prompt('Enter the number of ' + obj.data.hash.cnct[ params.noncat_type].name() + ' circulating:','1','Non-cataloged Items');
+                                                               var r = window.prompt(
+                                                                       document.getElementById('circStrings').getFormattedString('staff.circ.checkout.cmd_checkout_submit.msg', [obj.data.hash.cnct[params.noncat_type].name()]),
+                                                                       '1',
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.cmd_checkout_submit.title')
+                                                               );
                                                                if (r) {
                                                                        count = Number(r);
                                                                        if (count > 0) {
                                                                                if (count > 99) {
-                                                                                       obj.error.yns_alert('You tried to circulate ' + count + ' ' + obj.data.hash.cnct[ params.noncat_type].name() + '.  The maximum is 99 per action.','Non-cataloged Circulation','OK',null,null,'Check here to confirm this message.');
+                                                                                       obj.error.yns_alert(
+                                                                                               document.getElementById('circStrings').getFormattedString('staff.circ.checkout.cmd_checkout_submit.too_many.msg', [count, obj.data.hash.cnct[params.noncat_type].name()]),
+                                                                                               document.getElementById('circStrings').getString('staff.circ.checkout.cmd_checkout_submit.too_many.title'),
+                                                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                                                               null,
+                                                                                               null,
+                                                                                               document.getElementById('circStrings').getString('staff.circ.confirm')
+                                                                                       );
                                                                                        return;
                                                                                } else if (count > 20) {
-                                                                                       r = obj.error.yns_alert('Are you sure you want to circulate ' + count + ' ' + obj.data.hash.cnct[ params.noncat_type].name() + '?','Non-cataloged Circulation','Yes','No',null,'Check here to confirm this message.');
+                                                                                       r = obj.error.yns_alert(
+                                                                                               document.getElementById('circStrings').getFormattedString('staff.circ.checkout.cmd_checkout_submit.confirm.msg', [count, obj.data.hash.cnct[params.noncat_type].name()]),
+                                                                                               document.getElementById('circStrings').getString('staff.circ.checkout.cmd_checkout_submit.confirm.title'),
+                                                                                               document.getElementById('circStrings').getString('staff.circ.checkout.yes.btn'),
+                                                                                               document.getElementById('circStrings').getString('staff.circ.checkout.no.btn'),
+                                                                                               null,
+                                                                                               document.getElementById('circStrings').getString('staff.circ.confirm')
+                                                                                       );
                                                                                        if (r != 0) return;
                                                                                }
                                                                        } else {
-                                                                               r = obj.error.yns_alert('Error with non-cataloged checkout.  ' + r + ' is not a valid number.','Non-cataloged Circulation','Ok',null,null,'Check here to confirm this message.');
+                                                                               r = obj.error.yns_alert(
+                                                                                       document.getElementById('circStrings').getFormattedString('staff.circ.checkout.cmd_checkout_submit.non_numeric.msg', [r]),
+                                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.cmd_checkout_submit.non_numeric.title'),
+                                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                                                       null,
+                                                                                       null,
+                                                                                       document.getElementById('circStrings').getString('staff.circ.confirm')
+                                                                               );
                                                                                return;
                                                                        }
                                                                } else {
@@ -258,7 +283,7 @@ circ.checkout.prototype = {
                                }
                        }
                } catch(E) {
-                       obj.error.standard_unexpected_error_alert('Error determining whether to disable checkout.',E);
+                       obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.checkout.disable.error'),E);
                }
        },
 
@@ -309,9 +334,9 @@ circ.checkout.prototype = {
                                var todayPlus = new Date(); todayPlus.setTime( today.getTime() + 24*60*60*1000*pattern[1] );
                                node.value = util.date.formatted_date(todayPlus,"%F");
                        }
-                       if (! util.date.check('YYYY-MM-DD',node.value) ) { throw('Invalid Date'); }
-                       if (util.date.check_past('YYYY-MM-DD',node.value) ) { throw('Due date needs to be after today.'); }
-                       if ( util.date.formatted_date(new Date(),'%F') == node.value) { throw('Due date needs to be after today.'); }
+                       if (! util.date.check('YYYY-MM-DD',node.value) ) { throw(document.getElementById('circStrings').getString('staff.circ.invalid_date')); }
+                       if (util.date.check_past('YYYY-MM-DD',node.value) ) { throw(document.getElementById('circStrings').getString('staff.circ.checkout.date.too_early.error')); }
+                       if ( util.date.formatted_date(new Date(),'%F') == node.value) { throw(throw(document.getElementById('circStrings').getString('staff.circ.checkout.date.too_early.error')); }
                        return true;
                } catch(E) {
                        throw(E);
@@ -410,9 +435,9 @@ circ.checkout.prototype = {
                
                                } catch(E) {
                                        x.setAttribute('style','color: red');
-                                       x.setAttribute('value',params.barcode + ' failed.');
+                                       x.setAttribute('value', document.getElementById('circStrings').getFormattedString('staff.circ.checkout.barcode.failed', [params.barcode]));
                                        if (typeof params.noncat == 'undefined') obj.items_out_count--;
-                                       obj.error.standard_unexpected_error_alert('Check Out Failed #3',E);
+                                       obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkout.barcode.failed.alert', ['#3']),E);
                                }
                        }
 
@@ -421,7 +446,11 @@ circ.checkout.prototype = {
                
                        var x = document.createElement('label');
                        x.setAttribute('style','color: green');
-                       x.setAttribute('value',(params.barcode ? params.barcode : 'non-cat' ) + ' checkout pending...');
+                       if (params.barcode) {
+                               x.setAttribute('value',document.getElementById('circStrings').getFormattedString('staff.circ.checkout.barcode.pending', [params.barcode]));
+                       } else {
+                               x.setAttribute('value',document.getElementById('circStrings').getString('staff.circ.checkout.non_cataloged.pending'));
+                       }
                        document.getElementById('msg_area').appendChild(x);
 
                        obj.network.request(
@@ -437,9 +466,9 @@ circ.checkout.prototype = {
 
                } catch(E) {
                        x.setAttribute('style','color: red');
-                       x.setAttribute('value',params.barcode + ' failed.');
+                       x.setAttribute('value', document.getElementById('circStrings').getFormattedString('staff.circ.checkout.barcode.failed', [params.barcode]));
                        if (typeof params.noncat == 'undefined') obj.items_out_count--;
-                       obj.error.standard_unexpected_error_alert('Check Out Failed #2',E);
+                       obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkout.barcode.failed.alert', ['#2']),E);
                }
        },
 
@@ -453,12 +482,12 @@ circ.checkout.prototype = {
                        return true;
                } else {
                        if ( 1 == obj.error.yns_alert(
-                                               'Bad checkdigit; possible mis-scan.  Use this barcode ("' + bc + '") anyway?',
-                                               'Bad Barcode',
-                                               'Cancel',
-                                               'Accept Barcode',
+                                               document.getElementById('circStrings').getFormattedString('staff.circ.check_digit.bad', [bc]),
+                                               document.getElementById('circStrings').getString('staff.circ.barcode.bad'),
+                                               document.getElementById('circStrings').getString('staff.circ.cancel'),
+                                               document.getElementById('circStrings').getString('staff.circ.barcode.accept'),
                                                null,
-                                               'Check here to confirm this action',
+                                               document.getElementById('circStrings').getString('staff.circ.confirm'),
                                                '/xul/server/skin/media/images/bad_barcode.png'
                        ) ) {
                                return true;
@@ -509,7 +538,7 @@ circ.checkout.prototype = {
                                [ ses(), params, obj.items_out_count ],
                                null,
                                {
-                                       'title' : 'Override Checkout Failure?',
+                                       'title' : document.getElementById('circStrings').getString('staff.circ.checkout.override.confirm'),
                                        'overridable_events' : [ 
                                                1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
                                                1213 /* PATRON_BARRED */,
@@ -574,12 +603,12 @@ circ.checkout.prototype = {
                                if (test_event(permit,1202 /* ITEM_NOT_CATALOGED */)) {
 
                                        if ( 1 == obj.error.yns_alert(
-                                               'Mis-scan or non-cataloged item.  Checkout as a pre-cataloged item?',
-                                               'Alert',
-                                               'Cancel',
-                                               'Pre-Cat',
+                                               documents.getElementById('circStrings').getString('staff.circ.checkout.not_cataloged.confirm'),
+                                               documents.getElementById('circStrings').getString('staff.circ.alert'),
+                                               documents.getElementById('circStrings').getString('staff.circ.cancel'),
+                                               documents.getElementById('circStrings').getString('staff.circ.non_cataloged'),
                                                null,
-                                               'Check here to confirm this action',
+                                               document.getElementById('circStrings').getString('staff.circ.confirm'),
                                                '/xul/server/skin/media/images/book_question.png'
                                        ) ) {
 
@@ -593,7 +622,7 @@ circ.checkout.prototype = {
                                                params.dummy_author = obj.data.dummy_author;
                                                params.precat = 1;
 
-                                               if (params.dummy_title != '') { obj._checkout( params ); } else { throw('Checkout cancelled'); }
+                                               if (params.dummy_title != '') { obj._checkout( params ); } else { throw(document.getElementById('circStrings').getString('staff.circ.checkout.cancelled')); }
                                        } 
                                };
 
@@ -625,18 +654,39 @@ circ.checkout.prototype = {
                                                break;
                                                case 1216 /* PATRON_CARD_INACTIVE */ :
                                                        found_handled = true;
-                                                       msg += 'The card used to retrieve this account is inactive and may not be used to circulate items.\n';
-                                                       obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                       msg += document.getElementById('circStrings').getString('staff.circ.checkout.card.inactive') + '\n';
+                                                       obj.error.yns_alert(
+                                                               msg,
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                               null,
+                                                               null,
+                                                               document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                       );
                                                break;
                                                case 1217 /* PATRON_INACTIVE */ :
                                                        found_handled = true;
-                                                       msg += 'This account is inactive and may not circulate items.\n';
-                                                       obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                       msg += document.getElementById('circStrings').getString('staff.circ.checkout.account.inactive') + '\n';
+                                                       obj.error.yns_alert(
+                                                               msg,
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                               null,
+                                                               null,
+                                                               document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                       );
                                                break;
                                                case 1224 /* PATRON_ACCOUNT_EXPIRED */ :
                                                        found_handled = true;
-                                                       msg += 'This account has expired  and may not circulate items.\n';
-                                                       obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                       msg += document.getElementById('circStrings').getString('staff.circ.checkout.account.expired') + '\n';
+                                                       obj.error.yns_alert(
+                                                               msg,
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                               null,
+                                                               null,
+                                                               document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                       );
                                                break;
                                                case 7013 /* PATRON_EXCEEDS_FINES */ :
                                                        found_handled = true;
@@ -648,7 +698,7 @@ circ.checkout.prototype = {
                                                        found_handled = true;
                                                break;
                                                case 7004 /* COPY_NOT_AVAILABLE */ :
-                                                       msg += test_permit[i].desc + '\n' + 'Copy status = ' + ( test_permit[i].payload.status().name() ) + '\n';
+                                                       msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.copy_status', [test_permit[i].payload.status().name()]) + '\n';
                                                        found_handled = true;
                                                break;
                                                case 7006 /* COPY_IS_REFERENCE */ :
@@ -657,11 +707,18 @@ circ.checkout.prototype = {
                                                break;
                                                case 7009 /* CIRC_CLAIMS_RETURNED */ :
                                                        msg += test_permit[i].desc + '\n';
-                                                       obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                       obj.error.yns_alert(
+                                                               msg,
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                               null,
+                                                               null,
+                                                               document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                       );
                                                        found_handled = true;
                                                break;
                                                case 7010 /* COPY_ALERT_MESSAGE */ :
-                                                       msg += test_permit[i].desc + '\n' + 'Alert Message = ' + test_permit[i].payload + '\n';
+                                                       msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.alert_message', [test_permit[i].payload]) + '\n';
                                                        found_handled = true;
                                                break;
                                                case 7016 /* ITEM_ON_HOLDS_SHELF */ :
@@ -672,7 +729,7 @@ circ.checkout.prototype = {
                                                        found_handled = true;
                                                break;
                                                case 5000 /* PERM_FAILURE */ :
-                                                       msg += test_permit[i].desc + '\n' + 'Permission Denied = ' + test_permit[i].ilsperm + '\n';
+                                                       msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.permission_denied', [test_permit[i].ilsperm]) + '\n';
                                                        found_handled = true;
                                                break;
                                                case 1702 /* OPEN_CIRCULATION_EXISTS */ :
@@ -686,9 +743,20 @@ circ.checkout.prototype = {
                                                        my_circ = my_circ[0];
                                                        var due_date = my_circ.due_date() ? my_circ.due_date().substr(0,10) : null;
                                                        JSAN.use('util.date'); var today = util.date.formatted_date(new Date(),'%F');
-                                                       if (due_date) if (today > due_date) msg += '\nThis item was due on ' + due_date + '.\n';
+                                                       if (due_date) {
+                                                               if (today > due_date) {
+                                                                       msg += (document.getElementById('circStrings').getFormattedString('staff.circ.checkout.item_due', [due_date]) + '\n');
+                                                               }
+                                                       }
                                                        if (! stop_checkout ) {
-                                                               var r = obj.error.yns_alert(msg,'Check Out Failed','Cancel','Normal Checkin then Checkout', due_date ? (today > due_date ? 'Forgiving Checkin then Checkout' : null) : null,'Check here to confirm this message');
+                                                               var r = obj.error.yns_alert(
+                                                                       msg,
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.cancel'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.normal_checkin_then_checkout'),
+                                                                       due_date ? (today > due_date ? document.getElementById('circStrings').getString('staff.circ.checkout.forgiving_checkin_then_checkout') : null) : null,
+                                                                       document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                               );
                                                                JSAN.use('circ.util');
                                                                switch(r) {
                                                                        case 1:
@@ -701,14 +769,28 @@ circ.checkout.prototype = {
                                                                        break;
                                                                }
                                                        } else {
-                                                               obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                               obj.error.yns_alert(
+                                                                       msg,
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                                       null,
+                                                                       null,
+                                                                       document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                               );
                                                        }
                                                break;
                                                case 7014 /* COPY_IN_TRANSIT */ :
                                                        msg += test_permit[i].desc + '\n';
                                                        found_handled = true;
                                                        if (! stop_checkout ) {
-                                                               var r = obj.error.yns_alert(msg,'Check Out Failed','Cancel','Abort Transit then Checkout',null,'Check here to confirm this message');
+                                                               var r = obj.error.yns_alert(
+                                                                       msg,
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.cancel'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.abort_transit_then_checkout'),
+                                                                       null,
+                                                                       document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                               );
                                                                switch(r) {
                                                                        case 1:
                                                                                var robj = obj.network.simple_request('FM_ATC_VOID',[ ses(), { 'barcode' : params.barcode } ]);
@@ -729,13 +811,27 @@ circ.checkout.prototype = {
                                                                        break;
                                                                }
                                                        } else {
-                                                               obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                               obj.error.yns_alert(
+                                                                       msg,
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                                       document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                                       null,
+                                                                       null,
+                                                                       document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                               );
                                                        }
                                                break;
                                                case -1 /* NETWORK_FAILURE */ :
-                                                       msg += 'There was a network failure.\n';
+                                                       msg += document.getElementById('circStrings').getString('staff.circ.checkout.network_failure') + '\n';
                                                        found_handled = true;
-                                                       obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
+                                                       obj.error.yns_alert(
+                                                               msg,
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
+                                                               document.getElementById('circStrings').getString('staff.circ.checkout.ok.btn'),
+                                                               null,
+                                                               null,
+                                                               document.getElementById('circStrings').getString('staff.circ.confirm.msg')
+                                                       );
                                                break;
                                                default:
                                                        msg += 'FIXME: ' + js2JSON(test_permit[i]) + '\n';
@@ -755,9 +851,9 @@ circ.checkout.prototype = {
                } catch(E) {
                        if (params.barcode) { delete obj._checkout_pending_hash[ params.barcode ];      }
                        if (typeof E.ilsevent != 'undefined' && E.ilsevent == -1) {
-                               obj.error.standard_network_error_alert('Check Out Failed.  If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface');
+                               obj.error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkout.suggest_offline'));
                        } else {
-                               obj.error.standard_unexpected_error_alert('Check Out Failed',E);
+                               obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),E);
                        }
                        if (typeof obj.on_failure == 'function') {
                                obj.on_failure(E);
index 3f5c76a..ceab3c1 100644 (file)
@@ -82,6 +82,8 @@
        ]]>
        </script>
 
+       <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
+
        <commandset id="checkout_cmds">
                <command id="cmd_checkout_submit" />
                <command id="cmd_checkout_print" />
index c1a554d..1fed274 100644 (file)
@@ -1,3 +1,4 @@
+staff.circ.alert=Alert
 staff.circ.item_no_circs=Item %1$s has never circulated.
 staff.circ.invalid_date=Invalid Date
 staff.circ.future_date=Future Date
@@ -5,11 +6,12 @@ staff.circ.process_item=Check In / Process Item
 staff.circ.backdated_checkin=Backdated %1$s Check In
 staff.circ.backdate.exception=Problem setting backdate: %1$s
 staff.circ.unimplemented=Not Yet Implemented
-staff.circ.check_digit.bad=Bad check digit; possible mis-scan.  Use this barcode ("%1$s") anyway?
+staff.circ.check_digit.bad=Bad check digit, possibly due to a bad scan.  Use this barcode ("%1$s") anyway?
 staff.circ.barcode.bad=Bad Barcode
 staff.circ.cancel=Cancel
 staff.circ.barcode.accept=Accept Barcode
 staff.circ.confirm=Check here to confirm this action
+staff.circ.confirm.msg=Check here to confirm this message.
 # If we know the name of the object, we could parameterize that as well
 staff.circ.checkin.exception=Something went wrong in circ.util.checkin: %1$s
 staff.circ.checkin2.exception=Something went wrong in circ.util.checkin2: %1$s
@@ -19,3 +21,42 @@ staff.circ.checkin.exception.no_external=circ.checkin: Calling external .on_chec
 staff.circ.checkin2.exception.checkin2: circ.util.checkin2: No external .on_failure()
 staff.circ.util.checkin.exception.external=circ.util.checkin: Calling external .on_checkin()
 staff.circ.util.checkin.exception.no_external=circ.util.checkin: Calling external .on_checkin()
+staff.circ.checkout.sorting.exception=error in sorting non-cataloged items: %1$s
+staff.circ.checkout.date.exception=Use this format: YYYY-MM-DD
+staff.circ.checkout.unimplemented=Not Yet Implemented
+staff.circ.checkout.cmd_checkout_submit.msg=Enter the number of %1$s circulating:
+staff.circ.checkout.cmd_checkout_submit.title=Non-cataloged Items
+staff.circ.checkout.cmd_checkout_submit.too_many.msg=You tried to circulate %1$d %2$s.  The maximum is 99 per action.
+staff.circ.checkout.cmd_checkout_submit.too_many.title=Non-cataloged Circulation
+staff.circ.checkout.ok.btn=OK
+staff.circ.checkout.cmd_checkout_submit.confirm.msg=Are you sure you want to circulate %1$d %2$s?
+staff.circ.checkout.cmd_checkout_submit.confirm.title=Non-cataloged Circulation
+staff.circ.checkout.yes.btn=Yes
+staff.circ.checkout.no.btn=No
+staff.circ.checkout.cmd_checkout_submit.non_numeric.msg=Error with non-cataloged checkout.  %1$s is not a valid number.
+staff.circ.checkout.cmd_checkout_submit.non_numeric.title=Non-cataloged Circulation
+staff.circ.checkout.disable.error=Error determining whether to disable checkout.
+staff.circ.checkout.date.too_early.error=Due date needs to be after today.
+staff.circ.checkout.barcode.failed= %1$s failed.
+staff.circ.checkout.non_cataloged.pending=Non-cataloged checkout pending...
+staff.circ.checkout.barcode.pending=%1$s checkout pending...
+staff.circ.checkout.barcode.failed.alert=Check Out Failed %1$s
+staff.circ.checkout.override.confirm=Override Checkout Failure?
+staff.circ.checkout.not_cataloged.confirm=Mis-scan or non-cataloged item.  Checkout as a non-cataloged item?
+staff.circ.non_cataloged=Non-cataloged
+staff.circ.checkout.cancelled=Checkout cancelled
+staff.circ.checkout.card.inactive=The card used to retrieve this account is inactive and may not be used to circulate items.
+staff.circ.checkout.barcode.check_out_failed=Check Out Failed
+staff.circ.checkout.account.inactive=This account is inactive and may not circulate items.
+staff.circ.checkout.account.expired=This account has expired and may not circulate items.
+staff.circ.checkout.item_due=This item was due on %1$s.
+staff.circ.checkout.normal_checkin_then_checkout=Normal Checkin then Checkout
+staff.circ.checkout.forgiving_checkin_then_checkout=Forgiving Checkin then Checkout
+staff.circ.checkout.abort_transit_then_checkout=Abort Transit then Checkout
+staff.circ.checkout.network_failure=There was a network failure.
+staff.circ.checkout.copy_status=Copy status = %1$s
+staff.circ.checkout.alert_message=Alert Message = %1$s
+staff.circ.checkout.permission_denied=Permission Denied = %1$s
+# "Circulation" - check &staff.main.menu.circ.label; in lang.dtd
+# "Offline Interface" - check &staff.main.menu.circ.offline.label; in lang.dtd
+staff.circ.checkout.suggest_offline=Check Out Failed.  If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface