import classNames from 'classnames';
import { search, selectCurrent, selectNext, selectPrev } from '../actions';
-import { translateWithParameters } from '../../../helpers/l10n';
+import { translate, translateWithParameters } from '../../../helpers/l10n';
class Search extends Component {
componentDidMount () {
className={inputClassName}
type="search"
name="q"
- placeholder="Search"
+ placeholder={translate('search_verb')}
maxLength="100"
autoComplete="off"/>
<div className="note">
import { formatMeasure } from '../../../../helpers/measures';
import Workspace from '../../../../components/workspace/main';
import { getComponentUrl } from '../../../../helpers/urls';
+import { getLocalizedMetricName, translateWithParameters } from '../../../../helpers/l10n';
const HEIGHT = 500;
const BUBBLES_LIMIT = 500;
{this.renderBubbleChart()}
</div>
- <div className="measure-details-bubble-chart-axis x">{this.xMetric.name}</div>
- <div className="measure-details-bubble-chart-axis y">{this.yMetric.name}</div>
- <div className="measure-details-bubble-chart-axis size">Size: {this.sizeMetric.name}</div>
+ <div className="measure-details-bubble-chart-axis x">
+ {getLocalizedMetricName(this.xMetric)}
+ </div>
+ <div className="measure-details-bubble-chart-axis y">
+ {getLocalizedMetricName(this.yMetric)}
+ </div>
+ <div className="measure-details-bubble-chart-axis size">
+ {translateWithParameters('component_measures.legend.size_x', getLocalizedMetricName(this.sizeMetric))}
+ </div>
</div>
);
}
import { ComplexityDistribution } from '../../overview/components/complexity-distribution';
import { isDiffMetric, formatLeak } from '../utils';
import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
+import { getLocalizedMetricName } from '../../../helpers/l10n';
export default function MeasureDetailsHeader ({ measure, metric, secondaryMeasure, leakPeriod }) {
return (
<header className="measure-details-header">
<h2 className="measure-details-metric">
- {metric.name}
+ {getLocalizedMetricName(metric)}
</h2>
{isDiffMetric(metric) && (
import ComponentsListRow from './ComponentsListRow';
import EmptyComponentsList from './EmptyComponentsList';
import complementary from '../../config/complementary';
+import { getLocalizedMetricName } from '../../../../helpers/l10n';
const ComponentsList = ({ components, metrics, selected, metric, onClick }) => {
if (!components.length) {
<tr>
<th> </th>
<th className="text-right">
- <span className="small">{metric.name}</span>
+ <span className="small">{getLocalizedMetricName(metric)}</span>
</th>
{otherMetrics.map(metric => (
<th key={metric.key} className="text-right">
- <span className="small">{metric.name}</span>
+ <span className="small">{getLocalizedMetricName(metric)}</span>
</th>
))}
</tr>
import { getTimeMachineData } from '../../../../api/time-machine';
import { getEvents } from '../../../../api/events';
import { formatMeasure, getShortType } from '../../../../helpers/measures';
+import { translate } from '../../../../helpers/l10n';
const HEIGHT = 500;
return (
<div className="measure-details-history">
<div className="note text-center" style={{ lineHeight: `${HEIGHT}px` }}>
- There is no historical data.
+ {translate('component_measures.no_history')}
</div>
</div>
);
import { Treemap } from '../../../../components/charts/treemap';
import { getChildren } from '../../../../api/components';
import { formatMeasure } from '../../../../helpers/measures';
-import { translate, translateWithParameters } from '../../../../helpers/l10n';
+import { translate, translateWithParameters, getLocalizedMetricName } from '../../../../helpers/l10n';
import { getComponentUrl } from '../../../../helpers/urls';
import Workspace from '../../../../components/workspace/main';
const colorMeasure = component.measures[metric.key];
const formatted = colorMeasure != null ? formatMeasure(colorMeasure, metric.type) : '—';
- inner.push(`${metric.name}: ${formatted}`);
+ inner.push(`${getLocalizedMetricName(metric)}: ${formatted}`);
inner = inner.join('<br>');
return `<div class="text-left">${inner}</div>`;
<div className="measure-details-treemap">
<ul className="list-inline note measure-details-treemap-legend">
<li>
- {translateWithParameters('component_measures.legend.color_x', metric.name)}
+ {translateWithParameters('component_measures.legend.color_x', getLocalizedMetricName(metric))}
</li>
<li>
{translateWithParameters('component_measures.legend.size_x', translate('metric.ncloc.name'))}
import React from 'react';
import HomeMeasuresList from './HomeMeasuresList';
+import { getLocalizedMetricDomain } from '../../../helpers/l10n';
export default class AllMeasuresDomain extends React.Component {
render () {
<li>
{displayHeader && (
<header className="page-header">
- <h3 className="page-title">{domain.name}</h3>
+ <h3 className="page-title">
+ {getLocalizedMetricDomain(domain.name)}
+ </h3>
</header>
)}
import LeakPeriodLegend from '../components/LeakPeriodLegend';
import { getLeakPeriod } from '../../../helpers/periods';
-import { translate } from '../../../helpers/l10n';
+import { translate, getLocalizedMetricDomain } from '../../../helpers/l10n';
export default class Home extends React.Component {
componentDidMount () {
<Link
to={{ pathname: `domain/${domain.name}`, query: { id: component.key } }}
activeClassName="active">
- {domain.name}
+ {getLocalizedMetricDomain(domain.name)}
</Link>
</li>
))}
import MeasuresList from './MeasuresList';
import { domains } from '../config/domains';
+import { getLocalizedMetricName } from '../../../helpers/l10n';
function sortMeasures (measures, order) {
const [known, unknown] = partition(measures, measure => order.includes(measure.metric.key));
return [
...sortBy(known, measure => order.indexOf(measure.metric.key)),
- ...sortBy(unknown, measure => measure.metric.name)
+ ...sortBy(unknown, measure => getLocalizedMetricName(measure.metric))
];
}
import { Link } from 'react-router';
import MeasureListValue from './MeasureListValue';
+import { getLocalizedMetricName } from '../../../helpers/l10n';
const MeasuresList = ({ measures, component, className = 'domain-measures' }) => {
return (
<Link to={{ pathname: `metric/${measure.metric.key}`, query: { id: component.key } }}>
<div className="domain-measures-name">
<span id={`measure-${measure.metric.key}-name`}>
- {measure.metric.name}
+ {getLocalizedMetricName(measure.metric)}
</span>
</div>
import toPairs from 'lodash/toPairs';
import { RECEIVE_MEASURES } from './actions';
+import { getLocalizedMetricName } from '../../../helpers/l10n';
const initialState = {
measures: undefined,
const domains = sortBy(toPairs(groupBy(measures, measure => measure.metric.domain)).map(r => {
const [name, measures] = r;
- const sortedMeasures = sortBy(measures, measure => measure.metric.name);
+ const sortedMeasures = sortBy(measures, measure => getLocalizedMetricName(measure.metric));
return { name, measures: sortedMeasures };
}), 'name');
prepareSearch () {
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 2,
allowClear: false,
formatNoMatches () {
prepareSearch () {
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 2,
allowClear: false,
formatNoMatches () {
prepareSearch () {
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 2,
allowClear: false,
formatNoMatches () {
prepareSearchForViews () {
const componentId = this.options.app.state.get('contextComponentUuid');
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 2,
allowClear: false,
formatNoMatches () {
url += '&languages=' + languages;
}
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 2,
allowClear: false,
formatNoMatches () {
url += '&tags=' + tags;
}
return this.$('.js-custom-value').select2({
- placeholder: 'Search...',
+ placeholder: translate('search_verb'),
minimumInputLength: 0,
allowClear: false,
formatNoMatches () {
<li>
<input type="radio" name="issues-page-mode" value="count" id="issues-page-mode-count"
{{#eq mode 'count'}}checked{{/eq}}>
- <label for="issues-page-mode-count">Issues</label>
+ <label for="issues-page-mode-count">{{t 'issues.facet.mode.issues'}}</label>
</li>
<li>
<input type="radio" name="issues-page-mode" value="effort" id="issues-page-mode-effort"
{{#eq mode 'effort'}}checked{{/eq}}>
- <label for="issues-page-mode-effort">Effort</label>
+ <label for="issues-page-mode-effort">{{t 'issues.facet.mode.effort'}}</label>
</li>
</ul>
</div>
<div class="big-spacer-top">
or make a
- <a href="#resolved=false" class="button spacer-left">New Search</a>
+ <a href="#resolved=false" class="button spacer-left">{{t 'issues.home.new_search'}}</a>
</div>
</div>
import React from 'react';
import Select from 'react-select';
-import { translate } from '../../../helpers/l10n';
+import { translate, getLocalizedMetricName, getLocalizedMetricDomain } from '../../../helpers/l10n';
export default function AddConditionForm ({ metrics, onSelect }) {
function handleChange (option) {
const options = sortedMetrics.map(metric => {
return {
value: metric.key,
- label: metric.name,
+ label: getLocalizedMetricName(metric),
domain: metric.domain
};
});
if (!previous || previous.domain !== option.domain) {
optionsWithDomains.push({
value: option.domain,
- label: option.domain,
+ label: getLocalizedMetricDomain(option.domain),
disabled: true
});
}
import DeleteConditionView from '../views/gate-conditions-delete-view';
import Checkbox from '../../../components/shared/checkbox';
import { createCondition, updateCondition } from '../../../api/quality-gates';
-import { translate } from '../../../helpers/l10n';
+import { translate, getLocalizedMetricName } from '../../../helpers/l10n';
import { formatMeasure } from '../../../helpers/measures';
export default class Condition extends Component {
return (
<tr>
<td className="text-middle nowrap">
- {metric.name}
+ {getLocalizedMetricName(metric)}
{metric.hidden && (
<span className="text-danger little-spacer-left">
{translate('deprecated')}
import ConditionsAlert from './ConditionsAlert';
import AddConditionForm from './AddConditionForm';
import Condition from './Condition';
-import { translate } from '../../../helpers/l10n';
+import { translate, getLocalizedMetricName } from '../../../helpers/l10n';
function getKey (condition, index) {
return condition.id ? condition.id : `new-${index}`;
<p>{translate('quality_gates.duplicated_conditions')}</p>
<ul className="list-styled spacer-top">
{uniqDuplicates.map(d => (
- <li>{d.metric.name}</li>
+ <li>{getLocalizedMetricName(d.metric)}</li>
))}
</ul>
</div>
</div>
<div class="modal-body">
<div class="js-modal-messages"></div>
- {{tp 'quality_gates.delete_condition.confirm.message' metric.name}}
+ {{tp 'quality_gates.delete_condition.confirm.message' localizedMetricName}}
</div>
<div class="modal-foot">
<button id="delete-condition-submit">{{t 'delete'}}</button>
import ModalForm from '../../../components/common/modal-form';
import Template from '../templates/quality-gates-condition-delete.hbs';
import { deleteCondition } from '../../../api/quality-gates';
+import { getLocalizedMetricName } from '../../../helpers/l10n';
export default ModalForm.extend({
template: Template,
serializeData () {
return {
- metric: this.options.metric
+ metric: this.options.metric,
+ localizedMetricName: getLocalizedMetricName(this.options.metric)
};
}
});
{{#notEmpty profiles}}
<form class="spacer-bottom" id="quality-profile-comparison-form">
- <label class="text-middle" for="quality-profile-comparison-with-key">With</label>
+ <label class="text-middle" for="quality-profile-comparison-with-key">{{t 'with'}}</label>
<select id="quality-profile-comparison-with-key">
{{#each profiles}}
<option value="{{key}}" {{#eq key ../comparedWith}}selected{{/eq}}>{{name}}</option>
<div class="search-navigator-intro markdown">
- <p>Quality Profiles are collections of rules to apply during an analysis.</p>
- <p>For each language there is a default profile. All projects not explicitly assigned to some other profile will be
- analyzed with the default.</p>
+ <p>{{t 'quality_profiles.intro1'}}</p>
+ <p>{{t 'quality_profiles.intro2'}}</p>
</div>
className="spacer-left input-large"
type="search"
value={this.state.query}
- placeholder="Search..."
+ placeholder={translate('search_verb')}
onChange={this.handleSearch.bind(this)}/>
</div>
<div class="select-list-search-control">
<form class="search-box">
<span class="search-box-submit button-clean"><i class="icon-search"></i></span>
- <input class="search-box-input" type="search" name="q" placeholder="Search" maxlength="100" autocomplete="off">
+ <input class="search-box-input" type="search" name="q" placeholder="{{t 'search_verb'}}" maxlength="100" autocomplete="off">
</form>
</div>
</div>
<button class="search-box-submit button-clean">
<i class="icon-search-new"></i>
</button>
- <input class="search-box-input" type="search" placeholder="Search" value="{{query}}">
+ <input class="search-box-input" type="search" placeholder="{{t 'search_verb'}}" value="{{query}}">
</div>
<ul class="menu"></ul>
<button class="search-box-submit button-clean">
<i class="icon-search-new"></i>
</button>
- <input class="search-box-input" type="search" placeholder="Search" value="{{query}}">
+ <input class="search-box-input" type="search" placeholder="{{t 'search_verb'}}" value="{{query}}">
</div>
<ul class="menu"></ul>
import _ from 'underscore';
import React from 'react';
import RadioToggle from '../shared/radio-toggle';
+import { translate } from '../../helpers/l10n';
export default React.createClass({
componentWillMount() {
onChange={this.search}
ref="search"
type="search"
- placeholder="Search"
+ placeholder={translate('search_verb')}
initialValue={this.props.query}/>
</div>
</div>
const l10nLabel = translate(l10nKey);
return l10nLabel !== l10nKey ? l10nLabel : baseName;
}
+
+export function getLocalizedMetricName (metric) {
+ const bundleKey = `metric.${metric.key}.name`;
+ const fromBundle = translate(bundleKey);
+ return fromBundle !== bundleKey ? fromBundle : metric.name;
+}
+
+export function getLocalizedMetricDomain (domainName) {
+ const bundleKey = `metric_domain.${domainName}`;
+ const fromBundle = translate(bundleKey);
+ return fromBundle !== bundleKey ? fromBundle : domainName;
+}
view=View
views=Views
violations=Violations
+with=With
issues.home.projects=Projects
issues.home.authors=Authors
issues.home.tags=Tags
+issues.home.new_search=New Search
issues.toggle_selection_tooltip=(De-)Select all currently visible issues
issues.facet.createdAt.last_year=Last year
issues.facet.authors=Author
issues.facet.issues=Issue Key
+issues.facet.mode.issues=Issues
+issues.facet.mode.effort=Effort
#------------------------------------------------------------------------------
quality_profiles.projects.deselect_hint=Click to remove association between this project and the quality profile
quality_profiles.no_profiles_for_comparison=There are no profiles for comparison
quality_profiles.activate_more=Activate More
+quality_profiles.intro1=Quality Profiles are collections of rules to apply during an analysis.
+quality_profiles.intro2=For each language there is a default profile. All projects not explicitly assigned to some other profile will be analyzed with the default.
metric_domain.Maintainability=Maintainability
metric_domain.Reliability=Reliability
metric_domain.Security=Security
+metric_domain.Issues=Issues
+metric_domain.Duplications=Duplications
+metric_domain.Coverage=Coverage
#------------------------------------------------------------------------------
component_measures.legend.color_x=Color: {0}
component_measures.legend.size_x=Size: {0}
component_measures.x_of_y={0} of {1}
+component_measures.no_history=There is no historical data.