Patch from Craig Ricciuto:
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 May 2008 03:42:34 +0000 (03:42 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 May 2008 03:42:34 +0000 (03:42 +0000)
opac.xul changes:
  * Finished converting JavaScript strings

cat.properties changes:
  * Added the strings from opac.xul

git-svn-id: svn://svn.open-ils.org/ILS/trunk@9649 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/opac.xul
Open-ILS/xul/staff_client/server/locale/en-US/cat.properties

index e282de0..0e451e4 100644 (file)
@@ -32,6 +32,8 @@
        <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
        <script>
        <![CDATA[
+               function $(id) { return document.getElementById(id); }
+               function $w(id,text) { if ($(id)) util.widgets.set_text($(id),text); }
 
                var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame; 
                var browser_frame; var browser_obj; var browser_win;
@@ -44,7 +46,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( $("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();
@@ -66,8 +68,7 @@
                                set_opac();
 
                        } catch(E) {
-                               var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
-                                       "system administrator or software developer the following:\ncat/opac.xul\n" + E + '\n';
+                               var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/opac.xul', E]);
                                try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
                                alert(err_msg);
                        }
                                                                        if (typeof r.ilsevent != 'undefined') {
                                                                                throw(r);
                                                                        } else {
-                                                                               alert('Record successfully saved.');
+                                                                               alert( $("catStrings").getString('staff.cat.opac.set_marc_edit.alert') );
                                                                        }
                                                                } catch(E) {
-                                                                               g.error.standard_unexpected_error_alert('Record not likely updated.',E);
+                                                                               g.error.standard_unexpected_error_alert( $("catStrings").getString('staff.cat.opac.set_marc_edit.std_unexpected_error'), E );
                                                                }
                                                        }
                                                },
                }
 
                function refresh() {
-                       alert('Not yet implemented.  Work around: Choose Duplicate in New Tab option');
+                       alert( $("catStrings").getString('staff.cat.opac.refresh.function_not_implemented.alert') );
                }
        ]]>
        </script>
+       
+       <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
+       <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
+       <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
 
        <commandset><command id="cmd_forward"/><command id="cmd_back"/></commandset>
 
index dd57a08..6d780b0 100644 (file)
@@ -193,3 +193,6 @@ staff.cat.marc_new.record_created.label=Record created.
 staff.cat.marc_new.retrieving.label=Retrieving title...
 staff.cat.marc_new.creating_record.error=Error creating MARC record.
 staff.cat.marc_new.loading_template.error=Error loading MARC template: %1$s
+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