[open-ils-commits] r17617 - trunk/Open-ILS/xul/staff_client/chrome/content/main (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Sep 12 15:29:45 EDT 2010


Author: phasefx
Date: 2010-09-12 15:29:40 -0400 (Sun, 12 Sep 2010)
New Revision: 17617

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml
Log:
Allows you to create *_custom.properties files for overlaying stock strings with <messagecatalog>.

So for example, a recent commit changed how circ modifiers are displayed in the staff client, with

common.properties:
staff.circ_modifier.display=%1$s : %2$s : %3$s

You could do this for the original rendering:

common_custom.properties:
staff.circ_modifier.display=%1$s

The custom file need only contain the properties that you wish to change.

The xul <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" /> will attempt to parse both common.properties and common_custom.properties

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml	2010-09-12 19:04:48 UTC (rev 17616)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/bindings.xml	2010-09-12 19:29:40 UTC (rev 17617)
@@ -188,6 +188,17 @@
                                 var msg = "messageCatalog: No text from " + this.src;
                                 alert(msg); throw(msg);
                             }
+                           
+                            var custom_src = String(this.src).replace('.','_custom.'); 
+                            var x2 = new XMLHttpRequest();
+                            x2.open("GET",custom_src,false);
+                            x2.send(null);
+                            if (x2.responseText) {
+                                var props = this._props2object(x2.responseText);
+                                for (var i in props) {
+                                    this._props[i] = props[i];
+                                }
+                            }
                     } catch(E) {
                         alert('Error loading properties in messagecatalog in bindings.xml: ' + E);
                         throw(E);



More information about the open-ils-commits mailing list