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
}
];
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
}
];
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
}
];
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
);
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 = {};
},
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();
new dijit.form.Button(
{
- "label": "Apply", /* XXX i18n */
+ "label": localeStrings.APPLY,
"scrollOnFocus": false,
"onClick": function() {
if (self.onApply)
new dijit.form.Button(
{
- "label": "Cancel", /* XXX i18n */
+ "label": localeStrings.CANCEL,
"scrollOnFocus": false,
"onClick": function() {
if (self.onCancel)
--- /dev/null
+{
+ "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"
+}