import RangeFilters from '../../components/navigator/filters/range-filters';
import StringFilterView from '../../components/navigator/filters/string-filters';
import MetricFilterView from '../../components/navigator/filters/metric-filters';
+import { translate } from '../../helpers/l10n';
var NavigatorApp = new Marionette.Application(),
newLastAnalysisFilter = function () {
return new BaseFilters.Filter({
- name: window.SS.phrases.lastAnalysis,
+ name: translate('measure_filter.criteria.last_analysis'),
propertyFrom: 'ageMinDays',
propertyTo: 'ageMaxDays',
type: RangeFilters.RangeFilterView,
- placeholder: window.SS.phrases.days,
+ placeholder: translate('measure_filter.criteria.age.days'),
enabled: false,
optional: true
});
newMetricFilter = function (property) {
return new BaseFilters.Filter({
- name: window.SS.phrases.metric,
+ name: translate('measure_filter.criteria.metric'),
property: property,
type: MetricFilterView,
metrics: window.SS.metrics,
newNameFilter = function () {
return new BaseFilters.Filter({
- name: window.SS.phrases.nameContains,
+ name: translate('measure_filter.name_contains'),
property: 'nameSearch',
type: StringFilterView,
enabled: false,
newAlertFilter = function () {
return new BaseFilters.Filter({
- name: window.SS.phrases.alert,
+ name: translate('measure_filter.criteria.alert'),
property: 'alertLevels[]',
type: ChoiceFilters.ChoiceFilterView,
enabled: false,
optional: true,
choices: {
- 'error': window.SS.phrases.error,
- 'warn': window.SS.phrases.warning,
- 'ok': window.SS.phrases.ok
+ 'error': translate('measure_filter.criteria.alert.error'),
+ 'warn': translate('measure_filter.criteria.alert.warn'),
+ 'ok': translate('measure_filter.criteria.alert.ok')
}
});
},
this.filters.add([
new BaseFilters.Filter({
- name: window.SS.phrases.components,
+ name: translate('measure_filter.criteria.components'),
property: 'qualifiers[]',
type: ChoiceFilters.ChoiceFilterView,
enabled: true,
optional: false,
choices: window.SS.qualifiers,
- defaultValue: window.SS.phrases.any
+ defaultValue: translate('any')
}),
new BaseFilters.Filter({
- name: window.SS.phrases.componentsOf,
+ name: translate('measure_filter.criteria.components_of'),
property: 'base',
type: AjaxSelectFilters.ComponentFilterView,
multiple: false,
}),
new BaseFilters.Filter({
- name: window.SS.phrases.favoritesOnly,
+ name: translate('measure_filter.criteria.only_favorites'),
property: 'onFavourites',
type: CheckboxFilterView,
enabled: false,
}),
new BaseFilters.Filter({
- name: window.SS.phrases.date,
+ name: translate('measure_filter.criteria.date'),
propertyFrom: 'fromDate',
propertyTo: 'toDate',
type: RangeFilters.DateRangeFilterView,
}),
new BaseFilters.Filter({
- name: window.SS.phrases.keyContains,
+ name: translate('measure_filter.criteria.key_contains'),
property: 'keySearch',
type: StringFilterView,
enabled: false,
import _ from 'underscore';
import BaseFilters from './base-filters';
import Template from '../templates/metric-filter.hbs';
+import { translate } from '../../../helpers/l10n';
var DetailsMetricFilterView = BaseFilters.DetailsFilterView.extend({
template: Template,
var value = this.model.get('value') || {};
this.$('[name=metric]').val(value.metric).select2({
width: '100%',
- placeholder: window.SS.phrases.metric
+ placeholder: translate('measure_filter.criteria.metric')
});
this.$('[name=period]').val(value.period || 0).select2({
width: '100%',
renderValue: function () {
return this.isDefaultValue() ?
- window.SS.phrases.notSet :
+ translate('measure_filter.criteria.metric.not_set') :
this.model.get('value').metricText + ' ' + this.model.get('value').opText + ' ' +
this.model.get('value').valText;
},
import _ from 'underscore';
import BaseFilters from './base-filters';
import Template from '../templates/range-filter.hbs';
+import { translate } from '../../../helpers/l10n';
var DetailsRangeFilterView = BaseFilters.DetailsFilterView.extend({
template: Template,
var value = _.values(this.model.get('value'));
return value.join(' — ');
} else {
- return window.SS.phrases.any;
+ return translate('any');
}
},
var value = _.values(this.model.get('value'));
return value.join(' — ');
} else {
- return window.SS.phrases.anytime;
+ return translate('anytime')
}
}
{{/ifNotEmpty}}
<ul class="navigator-filter-select-list">
<li class="manage">
- <label id="manage-favorites">{{translate "manage" }}</label>
+ <label id="manage-favorites">{{t 'manage' }}</label>
</li>
</ul>
-<div class="navigator-filter-favorite-toggle" title="{{translate 'filtersList' }}"></div>
+<div class="navigator-filter-favorite-toggle" title="{{t 'measure_filter.filter_list'}}"></div>
</select>
<select name="period">
- <option value="0">{{translate "value"}}</option>
+ <option value="0">{{t 'value'}}</option>
{{#each periods}}
<option value="{{@key}}">{{this}}</option>
{{/each}}
<div class="navigator-filter-details-inner">
<input class="navigator-filter-range-input" type="text" name="{{propertyFrom}}" placeholder="{{placeholder}}">
- <label>{{translate "to"}}</label>
+ <label>{{t 'to.downcase'}}</label>
<input class="navigator-filter-range-input" type="text" name="{{propertyTo}}" placeholder="{{placeholder}}">
</div>
+++ /dev/null
-/*
- * SonarQube :: Web
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-module.exports = function () {
- var args = Array.prototype.slice.call(arguments, 0, -1);
- return window.translate.apply(this, args);
-};
days: '<%= message('work_duration.x_days') -%>',
hours: '<%= message('work_duration.x_hours') -%>',
minutes: '<%= message('work_duration.x_minutes') -%>'
- },
-
- phrases: {
- 'any': '<%= escape_javascript message('any') -%>',
- 'anytime': '<%= escape_javascript message('anytime') -%>',
- 'all': '<%= escape_javascript message('all') -%>',
- 'manage': '<%= escape_javascript message('manage') -%>',
- 'to': '<%= escape_javascript message('to.downcase') -%>',
- 'value': '<%= escape_javascript message('value') -%>',
- 'components': '<%= escape_javascript message('measure_filter.criteria.components') -%>',
- 'age': '<%= escape_javascript message('measure_filter.criteria.age') -%>',
- 'alert': '<%= escape_javascript message('measure_filter.criteria.alert') -%>',
- 'componentsOf': '<%= escape_javascript message('measure_filter.criteria.components_of') -%>',
- 'date': '<%= escape_javascript message('measure_filter.criteria.date') -%>',
- 'favoritesOnly': '<%= escape_javascript message('measure_filter.criteria.only_favorites') -%>',
- 'keyContains': '<%= escape_javascript message('measure_filter.criteria.key_contains') -%>',
- 'lastAnalysis': '<%= escape_javascript message('measure_filter.criteria.last_analysis') -%>',
- 'metric': '<%= escape_javascript message('measure_filter.criteria.metric') -%>',
- 'notSet': '<%= escape_javascript message('measure_filter.criteria.metric.not_set') -%>',
- 'nameContains': '<%= escape_javascript message('measure_filter.name_contains') -%>',
- 'moreCriteria': '<%= escape_javascript message('measure_filter.more_criteria') -%>',
- 'error': '<%= escape_javascript message('measure_filter.criteria.alert.error') -%>',
- 'warning': '<%= escape_javascript message('measure_filter.criteria.alert.warn') -%>',
- 'ok': '<%= escape_javascript message('measure_filter.criteria.alert.ok') -%>',
- 'days': '<%= escape_javascript message('measure_filter.criteria.age.days') -%>',
- 'filtersList': '<%= escape_javascript message('measure_filter.filter_list') -%>',
-
- 'work_duration': {
- 'x_days': '<%= escape_javascript message('work_duration.x_days') -%>',
- 'x_hours': '<%= escape_javascript message('work_duration.x_hours') -%>',
- 'x_minutes': '<%= escape_javascript message('work_duration.x_minutes') -%>'
- }
}
});