I18N
authorJason Etheridge <jason@esilibrary.com>
Wed, 6 Apr 2011 00:15:48 +0000 (20:15 -0400)
committerJason Etheridge <jason@esilibrary.com>
Wed, 6 Apr 2011 00:15:48 +0000 (20:15 -0400)
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/cat/manage_multi_home_items.js
Open-ILS/xul/staff_client/server/cat/manage_multi_home_items.xul
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties

index 23d7739..6f5b961 100644 (file)
 <!ENTITY staff.hold_list.cancel_hold_dialog.cancel_btn.accesskey "C">
 <!ENTITY staff.hold_list.cancel_hold_dialog.apply_btn.label "Apply">
 <!ENTITY staff.hold_list.cancel_hold_dialog.apply_btn.accesskey "A">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu.label "Actions for Selected Items">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu.accesskey "f">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.show_in_opac.label "Show in Catalog">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.show_in_opac.accesskey "S">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.change_peer_type.label "Change Peer Type">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.change_peer_type.accesskey "C">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.unlink_from_bib.label "Remove from Bib">
+<!ENTITY staff.cat.manage_multi_bib_items.actions.menu_entry.unlink_from_bib.accesskey "R">
+<!ENTITY staff.cat.manage_multi_bib_items.peer_type.menu.label "Peer Type:">
+<!ENTITY staff.cat.manage_multi_bib_items.peer_type.menu.accesskey "T">
+<!ENTITY staff.cat.manage_multi_bib_items.barcode.textbox.label "Barcode:">
+<!ENTITY staff.cat.manage_multi_bib_items.barcode.textbox.accesskey "B">
+<!ENTITY staff.cat.manage_multi_bib_items.barcode.submit.label "Add to Bib">
+<!ENTITY staff.cat.manage_multi_bib_items.barcode.submit.accesskey "A">
 <!ENTITY staff.cat.copy_browser.actions.sel_clip.label "Copy to Clipboard">
 <!ENTITY staff.cat.copy_browser.actions.sel_clip.accesskey "C">
 <!ENTITY staff.cat.copy_browser.actions.cmd_add_items_to_buckets.label "Add Items to Buckets">
index 802710b..656019f 100644 (file)
@@ -14,7 +14,7 @@ function my_init() {
         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
 
         commonStrings = $('commonStrings');
-        patronStrings = $('patronStrings');
+        catStrings = $('catStrings');
 
         if (typeof JSAN == 'undefined') {
             throw(
@@ -49,8 +49,13 @@ function my_init() {
         $('scanbox').addEventListener('keypress', handle_keypress, false);
         default_focus();
 
-        if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
-            try { window.xulG.set_tab_name('Manage Multi-Home Items for Bib ' + xul_param('docid')); } catch(E) { alert(E); }
+        if (typeof xulG.set_tab_name == 'function') {
+            xulG.set_tab_name(
+                catStrings.getFormattedString(
+                    'staff.cat.manage_multi_bib_items.tab_name',
+                    [ xul_param('docid') ]
+                )
+            );
         }
 
     } catch(E) {
@@ -177,7 +182,7 @@ function handle_submit(create,my_bpbcm) {
         function handle_req(req) {
             try {
                 var robj = req.getResultObject();
-                row_params.row.my.result = 'Error';
+                row_params.row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.error');
                 if (typeof robj.ilsevent != 'undefined') {
                     row_params.row.my.result = robj.textcode;
                 } else {
@@ -197,18 +202,17 @@ function handle_submit(create,my_bpbcm) {
                             new_bpbcm.target_copy(robj.copy.id());
                         pcrud.create(new_bpbcm, {
                             "onerror" : function(r) {
-                                alert('here');
-                                alert(js2JSON(r));
+                                dump('onerror, r = ' + js2JSON(r) + '\n');
                             },
                             "oncomplete": function (r, objs) {
                                 try {
                                     var obj = objs[0];
                                     if (obj) {
-                                        row_params.row.my.result = 'Success';
+                                        row_params.row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.success');
                                         row_params.row.my.bpbcm = obj;
                                         bpbcm_barcode_map[ obj.id() ] = robj.copy.barcode();
                                     } else {
-                                        row_params.row.my.result = 'Failed';
+                                        row_params.row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.failed');
                                         sound.bad();
                                     }
                                     list.refresh_row( row_params );
@@ -219,9 +223,9 @@ function handle_submit(create,my_bpbcm) {
                         });
                     } else {
                         if (robj.mvr.doc_id() != xul_param('docid')) {
-                            row_params.row.my.result = 'Item linked to Bib';
+                            row_params.row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.item_linked_to_bib');
                         } else {
-                            row_params.row.my.result = 'Item native to Bib';
+                            row_params.row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.item_native_to_bib');
                         }
                     }
                 }
@@ -295,8 +299,14 @@ function handle_change() {
         if (eligibles.length > 0) {
             if (window.confirm(
                 eligibles.length == 1
-                ? 'Change peer type on selected item to ' + data.hash.bpt[ $('bpt_menu').value ].name()
-                : 'Change peer type on ' + eligibles.length + ' selected items to '+ data.hash.bpt[ $('bpt_menu').value ].name())
+                ? catStrings.getFormattedString(
+                        'staff.cat.manage_multi_bib_items.prompt.confirm.peer_type_updated.singular',
+                        [ data.hash.bpt[ $('bpt_menu').value ].name() ]
+                )
+                : catStrings.getFormattedString(
+                        'staff.cat.manage_multi_bib_items.prompt.confirm.peer_type_updated.plural',
+                        [ data.hash.bpt[ $('bpt_menu').value ].name(), eligibles.length ]
+                ))
             ) {
                 var bpbcm_list = [];
                 for (var i = 0; i < eligibles.length; i++) {
@@ -320,7 +330,7 @@ function handle_change() {
                                 var bpbcm_id = ids[i];
                                 try {
                                     rows[ bpbcm_barcode_map[ bpbcm_id ] ].row.my.bpbcm.peer_type( $('bpt_menu').value );
-                                    rows[ bpbcm_barcode_map[ bpbcm_id ] ].row.my.result = 'Peer Type Updated';
+                                    rows[ bpbcm_barcode_map[ bpbcm_id ] ].row.my.result = catStrings.getString('staff.cat.manage_multi_bib_items.result.column.value.peer_type_update');
                                     list.refresh_row( rows[ bpbcm_barcode_map[ bpbcm_id ] ] );
                                 } catch(E) {
                                     alert('error in oncomplete: ' + E);
@@ -350,8 +360,14 @@ function handle_remove() {
         if (eligibles.length > 0) {
             if (window.confirm(
                 eligibles.length == 1
-                ? 'Unlink selected item from bib #' + xul_param('docid')
-                : 'Unlink ' + eligibles.length + ' selected items from bib #' + xul_param('docid'))
+                ? catStrings.getFormattedString(
+                        'staff.cat.manage_multi_bib_items.prompt.confirm.unlink_item_from_bib.singular',
+                        [ xul_param('docid') ]
+                )
+                : catStrings.getFormattedString(
+                        'staff.cat.manage_multi_bib_items.prompt.confirm.unlink_item_from_bib.plural',
+                        [ xul_param('docid'), eligibles.length ]
+                ))
             ) {
                 var bpbcm_list = [];
                 for (var i = 0; i < eligibles.length; i++) {
index e1a11ec..e090a55 100644 (file)
     </script>
     <scripts id="openils_util_scripts"/>
 
+    <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
+
     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
     <script type="text/javascript" src="manage_multi_home_items.js"/>
 
     <commandset>
-        <command id="opac" label="Show in Catalog" accesskey="S"/>
-        <command id="change" label="Change Peer Type" accesskey="C"/>
-        <command id="remove" label="Remove from Bib" accesskey="R"/>
+        <command id="opac"
+            label="&staff.cat.manage_multi_bib_items.actions.menu_entry.show_in_opac.label;"
+            accesskey="&staff.cat.manage_multi_bib_items.actions.menu_entry.show_in_opac.accesskey;"/>
+        <command id="change"
+            label="&staff.cat.manage_multi_bib_items.actions.menu_entry.change_peer_type.label;"
+            accesskey="&staff.cat.manage_multi_bib_items.actions.menu_entry.change_peer_type.accesskey;"/>
+        <command id="remove"
+            label="&staff.cat.manage_multi_bib_items.actions.menu_entry.unlink_from_bib.label;"
+            accesskey="&staff.cat.manage_multi_bib_items.actions.menu_entry.unlink_from_bib.accesskey;"/>
     </commandset>
 
     <popupset>
 
     <vbox flex="1" class="my_overflow">
         <hbox>
-            <label value="Peer Type:" accesskey="T" control="bpt_menu"/>
+            <label control="bpt_menu"
+                value="&staff.cat.manage_multi_bib_items.peer_type.menu.label;"
+                accesskey="&staff.cat.manage_multi_bib_items.peer_type.menu.accesskey;"/>
             <hbox id="menu_placeholder" />
-            <label control="scanbox" value="Barcode:" accesskey="B"/>
+            <label control="scanbox"
+                value="&staff.cat.manage_multi_bib_items.barcode.textbox.label;"
+                accesskey="&staff.cat.manage_multi_bib_items.barcode.textbox.accesskey;"/>
             <textbox id="scanbox"/>
-            <button id="submit" label="Add to Bib" accesskey="A"/>
+            <button id="submit"
+                label="&staff.cat.manage_multi_bib_items.barcode.submit.label;"
+                accesskey="&staff.cat.manage_multi_bib_items.barcode.submit.accesskey;"/>
             <spacer flex="1"/>
             <menubar>
-                <menu label="Actions for Selected Items" accesskey="f">
+                <menu label="&staff.cat.manage_multi_bib_items.actions.menu.label;" accesskey="&staff.cat.manage_multi_bib_items.actions.menu.accesskey;">
                     <menupopup>
                         <menuitem command="opac" />
                         <menuitem command="change" />
index b71cdb5..86893ca 100644 (file)
@@ -9,6 +9,22 @@ staff.cat.bib_brief.deleted=(Deleted)
 staff.cat.bib_brief.inactive=(Inactive)
 staff.cat.bib_brief.noncat=(Not Cataloged)
 staff.cat.bib_brief.noncat.alert=Item not cataloged.
+# %1$s = Bib Record ID
+staff.cat.manage_multi_bib_items.tab_name=Manage Multi-Home Items for Bib %1$s
+staff.cat.manage_multi_bib_items.result.column.value.error=Error
+staff.cat.manage_multi_bib_items.result.column.value.success=Success
+staff.cat.manage_multi_bib_items.result.column.value.failed=Failed
+staff.cat.manage_multi_bib_items.result.column.value.item_linked_to_bib=Item linked to bib
+staff.cat.manage_multi_bib_items.result.column.value.item_native_to_bib=Item native to bib
+staff.cat.manage_multi_bib_items.result.column.value.peer_type_updated=Peer Type updated
+# %1$s = Peer Type
+staff.cat.manage_multi_bib_items.prompt.confirm.peer_type_updated.singular=Change peer type on selected item to %1$s
+# %1$s = Peer Type, %2$s = Number of selected items
+staff.cat.manage_multi_bib_items.prompt.confirm.peer_type_updated.plural=Change peer type on %2$s selected items to %1$s
+# %1$s = Bib Record ID
+staff.cat.manage_multi_bib_items.prompt.confirm.unlink_item_from_bib.singular=Unlink selected item from Bib %1$s
+# %1$s = Bib Record ID, %2$s = Number of selected items
+staff.cat.manage_multi_bib_items.prompt.confirm.unlink_item_from_bib.plural=Unlink %2$s selected items from Bib %1$s
 staff.cat.copy_browser.add_item.title=Add Item
 staff.cat.copy_browser.add_item.error=copy browser -> add copies
 staff.cat.copy_browser.add_items_bucket.error=copy browser -> add copies to bucket