tweaks to make this other implementation work; but need to re-test the original in...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Aug 2007 16:44:03 +0000 (16:44 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 14 Aug 2007 16:44:03 +0000 (16:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7662 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/bindings.xml

index 29d0b4b..e4bbb58 100644 (file)
@@ -49,6 +49,9 @@
                                                for (var i in props) {
                                                        this._props[i] = props[i];
                                                }
+                                       } else {
+                                               var msg = "messageCatalog: No text from " + this.src;
+                                               alert(msg); throw(msg);
                                        }
                                        ]]>
                                </body>
@@ -88,7 +91,7 @@
                                                } while ( cont == true );
 
                                                props[k] = v;
-                               }
+                                       }
 
                                        return props;
                                        ]]>
                                                try {
                                                        return this._props[key];
                                                } catch(e) {
-                                                       dump("*** Failed to get string " + key + " in bundle: " + this.src + "\n");
+                                                       alert("*** Failed to get string " + key + " in bundle: " + this.src + "\n");
                                                        throw(e);
                                                }
                                        ]]>
                                <body>
                                        <![CDATA[
                                                try {
-                                                       var str = this._props[key];
-                                                       var val = this.sprintf.apply(this,[ str ].concat(params));
+                                                       var str = this._props[key]; if (!str) throw("messageCatalog: Failed to get string " + key + " in bundle.");
+                                                       var these = [ str ].concat(params);
+                                                       var val = this.sprintf.apply(this,these);
                                                        return val;
                                                } catch(e) {
-                                                       dump("*** Failed to get string " + key + " in bundle: " + this.src + "\n");
+                                                       alert("*** Failed to get string " + key + " in bundle: " + this.src + "\n");
                                                        throw(e);
                                                }
                                        ]]>
                                                        }
 
                                                        var a = arguments, i = 0, format = a[i++];
-                                                       return format.replace(sprintf.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) {
+                                                       return format.replace(this.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) {
                                                                if (substring == '%%') return '%';
 
                                                                // parse flags