pcrudfilterdialog: i18n
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Sat, 7 Jan 2012 20:46:17 +0000 (15:46 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Sat, 7 Jan 2012 20:46:17 +0000 (15:46 -0500)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/js/dojo/openils/widget/PCrudFilterDialog.js
Open-ILS/web/js/dojo/openils/widget/nls/PCrudFilterDialog.js [new file with mode: 0644]

index 04f3e98..c44ca65 100644 (file)
@@ -7,22 +7,27 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
     dojo.require('dijit.Dialog');
     dojo.require('openils.Util');
 
+    dojo.requireLocalization("openils.widget", "PCrudFilterDialog");
+    var localeStrings = dojo.i18n.getLocalization(
+        "openils.widget", "PCrudFilterDialog"
+    );
+
     var _minimal_operators = [
         {
             "name": "=",
-            "label": "is",
+            "label": localeStrings.OPERATOR_EQ,
             "param_count": 1
         }, {
             "name": "!=",
-            "label": "is not",
+            "label": localeStrings.OPERATOR_NE,
             "param_count": 1
         }, {
             "name": "null",
-            "label": "is null",
+            "label": localeStrings.OPERATOR_IS_NULL,
             "param_count": 0
         }, {
             "name": "not null",
-            "label": "is not null",
+            "label": localeStrings.OPERATOR_IS_NOT_NULL,
             "param_count": 0
         }
     ];
@@ -30,27 +35,27 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
     var _strict_operators = [
         {
             "name": ">",
-            "label": "is greater than",
+            "label": localeStrings.OPERATOR_GT,
             "param_count": 1
         }, {
             "name": "<",
-            "label": "is less than",
+            "label": localeStrings.OPERATOR_LT,
             "param_count": 1
         }, {
             "name": ">=",
-            "label": "is greater than or equal to",
+            "label": localeStrings.OPERATOR_GTE,
             "param_count": 1
         }, {
             "name": "<=",
-            "label": "is less than or equal to",
+            "label": localeStrings.OPERATOR_LTE,
             "param_count": 1
         }, {
             "name": "between",
-            "label": "is between",
+            "label": localeStrings.OPERATOR_BETWEEN,
             "param_count": 2
         }, {
             "name": "not between",
-            "label": "is not between",
+            "label": localeStrings.OPERATOR_NOT_BETWEEN,
             "param_count": 2
         }
     ];
@@ -58,11 +63,11 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
     var _fuzzy_operators = [
         {
             "name": "like",
-            "label": "is like",
+            "label": localeStrings.OPERATOR_LIKE,
             "param_count": 1
         }, {
             "name": "not like",
-            "label": "is not like",
+            "label": localeStrings.OPERATOR_NOT_LIKE,
             "param_count": 1
         }
     ];
@@ -144,7 +149,7 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
             dojo.create(
                 "td", {
                     "colspan": 4,
-                    "innerHTML": "Add rows to filter results, or just click Apply to see unfiltered results." /* XXX i18n */
+                    "innerHTML": localeStrings.EMPTY_CASE
                 }, tr
             );
 
@@ -467,7 +472,7 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
             constructor : function(args) {
                 for(var k in args)
                     this[k] = args[k];
-                this.title = this.title || "Filter Results"; /* XXX i18n */
+                this.title = this.title || localeStrings.DEFAULT_DIALOG_TITLE;
                 this.widgetIndex = 0;
                 this.widgetCache = {};
             },
@@ -511,7 +516,7 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
 
                 new dijit.form.Button(
                     {
-                        "label": "Add Row", /* XXX i18n */
+                        "label": localeStrings.ADD_ROW,
                         "scrollOnFocus": false, /* almost always better */
                         "onClick": function() {
                             self.filter_row_manager.add_row();
@@ -521,7 +526,7 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
 
                 new dijit.form.Button(
                     {
-                        "label": "Apply", /* XXX i18n */
+                        "label": localeStrings.APPLY,
                         "scrollOnFocus": false,
                         "onClick": function() {
                             if (self.onApply)
@@ -533,7 +538,7 @@ if(!dojo._hasResource['openils.widget.PCrudFilterDialog']) {
 
                 new dijit.form.Button(
                     {
-                        "label": "Cancel", /* XXX i18n */
+                        "label": localeStrings.CANCEL,
                         "scrollOnFocus": false,
                         "onClick": function() {
                             if (self.onCancel)
diff --git a/Open-ILS/web/js/dojo/openils/widget/nls/PCrudFilterDialog.js b/Open-ILS/web/js/dojo/openils/widget/nls/PCrudFilterDialog.js
new file mode 100644 (file)
index 0000000..9ad4e97
--- /dev/null
@@ -0,0 +1,19 @@
+{
+    "OPERATOR_EQ": "is",
+    "OPERATOR_NE": "is not",
+    "OPERATOR_IS_NULL": "is null",
+    "OPERATOR_IS_NOT_NULL": "is not null",
+    "OPERATOR_LT": "is less than",
+    "OPERATOR_GT": "is greater than",
+    "OPERATOR_LTE": "is less than or equal to",
+    "OPERATOR_GTE": "is greater than or equal to",
+    "OPERATOR_BETWEEN": "is between",
+    "OPERATOR_NOT_BETWEEN": "is not between",
+    "OPERATOR_LIKE": "is like",
+    "OPERATOR_NOT_LIKE": "is not like",
+    "EMPTY_CASE": "Add rows to filter results, or just click Apply to see unfiltered results.",
+    "DEFAULT_DIALOG_TITLE": "Filter Results",
+    "ADD_ROW": "Add Row",
+    "APPLY": "Apply",
+    "CANCEL": "Cancel"
+}