@@ -3,23 +3,23 @@ QueryBuilder.templates.group = '\
33 <dt class="rules-group-header"> \
44 <div class="btn-group pull-right group-actions"> \
55 <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") }} \
77 </button> \
88 {{? it.settings.allow_groups===-1 || it.settings.allow_groups>=it.level }} \
99 <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") }} \
1111 </button> \
1212 {{?}} \
1313 {{? it.level>1 }} \
1414 <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") }} \
1616 </button> \
1717 {{?}} \
1818 </div> \
1919 <div class="btn-group group-conditions"> \
2020 {{~ it.conditions: condition }} \
2121 <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) }} \
2323 </label> \
2424 {{~}} \
2525 </div> \
@@ -37,7 +37,7 @@ QueryBuilder.templates.rule = '\
3737 <div class="rule-header"> \
3838 <div class="btn-group pull-right rule-actions"> \
3939 <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") }} \
4141 </button> \
4242 </div> \
4343 </div> \
@@ -70,7 +70,7 @@ QueryBuilder.templates.filterSelect = '\
7070QueryBuilder . templates . operatorSelect = '\
7171{{? it.operators.length === 1 }} \
7272<span> \
73- {{= it.lang. operators[it.operators[0].type] || it.operators[0].type }} \
73+ {{= it.translate(" operators", it.operators[0].type) }} \
7474</span> \
7575{{?}} \
7676{{ var optgroup = null; }} \
@@ -82,7 +82,7 @@ QueryBuilder.templates.operatorSelect = '\
8282 <optgroup label="{{= it.translate(it.settings.optgroups[optgroup]) }}"> \
8383 {{?}} \
8484 {{?}} \
85- <option value="{{= operator.type }}">{{= it.lang. operators[operator.type] || operator.type }}</option> \
85+ <option value="{{= operator.type }}">{{= it.translate(" operators", operator.type) }}</option> \
8686 {{~}} \
8787 {{? optgroup !== null }}</optgroup>{{?}} \
8888</select>' ;
@@ -102,8 +102,8 @@ QueryBuilder.prototype.getGroupTemplate = function(group_id, level) {
102102 level : level ,
103103 conditions : this . settings . conditions ,
104104 icons : this . icons ,
105- lang : this . lang ,
106- settings : this . settings
105+ settings : this . settings ,
106+ translate : this . translate . bind ( this )
107107 } ) ;
108108
109109 /**
@@ -129,8 +129,8 @@ QueryBuilder.prototype.getRuleTemplate = function(rule_id) {
129129 builder : this ,
130130 rule_id : rule_id ,
131131 icons : this . icons ,
132- lang : this . lang ,
133- settings : this . settings
132+ settings : this . settings ,
133+ translate : this . translate . bind ( this )
134134 } ) ;
135135
136136 /**
@@ -157,9 +157,8 @@ QueryBuilder.prototype.getRuleFilterSelect = function(rule, filters) {
157157 rule : rule ,
158158 filters : filters ,
159159 icons : this . icons ,
160- lang : this . lang ,
161160 settings : this . settings ,
162- translate : this . getTranslatedLabel
161+ translate : this . translate . bind ( this )
163162 } ) ;
164163
165164 /**
@@ -188,9 +187,8 @@ QueryBuilder.prototype.getRuleOperatorSelect = function(rule, operators) {
188187 rule : rule ,
189188 operators : operators ,
190189 icons : this . icons ,
191- lang : this . lang ,
192190 settings : this . settings ,
193- translate : this . getTranslatedLabel
191+ translate : this . translate . bind ( this )
194192 } ) ;
195193
196194 /**
0 commit comments