@@ -3,23 +3,23 @@ QueryBuilder.templates.group = '\
3
3
<dt class="rules-group-header"> \
4
4
<div class="btn-group pull-right group-actions"> \
5
5
<button type="button" class="btn btn-xs btn-success" data-add="rule"> \
6
- <i class="{{= it.icons.add_rule }}"></i> {{= it.lang. add_rule }} \
6
+ <i class="{{= it.icons.add_rule }}"></i> {{= it.translate(" add_rule") }} \
7
7
</button> \
8
8
{{? it.settings.allow_groups===-1 || it.settings.allow_groups>=it.level }} \
9
9
<button type="button" class="btn btn-xs btn-success" data-add="group"> \
10
- <i class="{{= it.icons.add_group }}"></i> {{= it.lang. add_group }} \
10
+ <i class="{{= it.icons.add_group }}"></i> {{= it.translate(" add_group") }} \
11
11
</button> \
12
12
{{?}} \
13
13
{{? it.level>1 }} \
14
14
<button type="button" class="btn btn-xs btn-danger" data-delete="group"> \
15
- <i class="{{= it.icons.remove_group }}"></i> {{= it.lang. delete_group }} \
15
+ <i class="{{= it.icons.remove_group }}"></i> {{= it.translate(" delete_group") }} \
16
16
</button> \
17
17
{{?}} \
18
18
</div> \
19
19
<div class="btn-group group-conditions"> \
20
20
{{~ it.conditions: condition }} \
21
21
<label class="btn btn-xs btn-primary"> \
22
- <input type="radio" name="{{= it.group_id }}_cond" value="{{= condition }}"> {{= it.lang. conditions[condition] || condition }} \
22
+ <input type="radio" name="{{= it.group_id }}_cond" value="{{= condition }}"> {{= it.translate(" conditions", condition) }} \
23
23
</label> \
24
24
{{~}} \
25
25
</div> \
@@ -37,7 +37,7 @@ QueryBuilder.templates.rule = '\
37
37
<div class="rule-header"> \
38
38
<div class="btn-group pull-right rule-actions"> \
39
39
<button type="button" class="btn btn-xs btn-danger" data-delete="rule"> \
40
- <i class="{{= it.icons.remove_rule }}"></i> {{= it.lang. delete_rule }} \
40
+ <i class="{{= it.icons.remove_rule }}"></i> {{= it.translate(" delete_rule") }} \
41
41
</button> \
42
42
</div> \
43
43
</div> \
@@ -70,7 +70,7 @@ QueryBuilder.templates.filterSelect = '\
70
70
QueryBuilder . templates . operatorSelect = '\
71
71
{{? it.operators.length === 1 }} \
72
72
<span> \
73
- {{= it.lang. operators[it.operators[0].type] || it.operators[0].type }} \
73
+ {{= it.translate(" operators", it.operators[0].type) }} \
74
74
</span> \
75
75
{{?}} \
76
76
{{ var optgroup = null; }} \
@@ -82,7 +82,7 @@ QueryBuilder.templates.operatorSelect = '\
82
82
<optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}"> \
83
83
{{?}} \
84
84
{{?}} \
85
- <option value="{{= operator.type }}">{{= it.lang. operators[operator.type] || operator.type }}</option> \
85
+ <option value="{{= operator.type }}">{{= it.translate(" operators", operator.type) }}</option> \
86
86
{{~}} \
87
87
{{? optgroup !== null }}</optgroup>{{?}} \
88
88
</select>' ;
@@ -102,8 +102,8 @@ QueryBuilder.prototype.getGroupTemplate = function(group_id, level) {
102
102
level : level ,
103
103
conditions : this . settings . conditions ,
104
104
icons : this . icons ,
105
- lang : this . lang ,
106
- settings : this . settings
105
+ settings : this . settings ,
106
+ translate : this . translate . bind ( this )
107
107
} ) ;
108
108
109
109
/**
@@ -129,8 +129,8 @@ QueryBuilder.prototype.getRuleTemplate = function(rule_id) {
129
129
builder : this ,
130
130
rule_id : rule_id ,
131
131
icons : this . icons ,
132
- lang : this . lang ,
133
- settings : this . settings
132
+ settings : this . settings ,
133
+ translate : this . translate . bind ( this )
134
134
} ) ;
135
135
136
136
/**
@@ -157,9 +157,8 @@ QueryBuilder.prototype.getRuleFilterSelect = function(rule, filters) {
157
157
rule : rule ,
158
158
filters : filters ,
159
159
icons : this . icons ,
160
- lang : this . lang ,
161
160
settings : this . settings ,
162
- translate : this . getTranslatedLabel
161
+ translate : this . translate . bind ( this )
163
162
} ) ;
164
163
165
164
/**
@@ -188,9 +187,8 @@ QueryBuilder.prototype.getRuleOperatorSelect = function(rule, operators) {
188
187
rule : rule ,
189
188
operators : operators ,
190
189
icons : this . icons ,
191
- lang : this . lang ,
192
190
settings : this . settings ,
193
- translate : this . getTranslatedLabel
191
+ translate : this . translate . bind ( this )
194
192
} ) ;
195
193
196
194
/**
0 commit comments