Allows you to create *_custom.properties files for overlaying stock strings with...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 12 Sep 2010 19:29:40 +0000 (19:29 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 12 Sep 2010 19:29:40 +0000 (19:29 +0000)
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

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

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

index e3bc819..d17f839 100644 (file)
                                 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);