From 2715a0716e230a7cf92d6d4414af99ad98d7830c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 13 May 2016 11:57:38 +0200 Subject: [PATCH] SONAR-7634 Metric names should be localized (#967) --- .../src/main/js/apps/code/components/Search.js | 4 ++-- .../components/bubbleChart/BubbleChart.js | 13 ++++++++++--- .../details/MeasureDetailsHeader.js | 3 ++- .../details/drilldown/ComponentsList.js | 5 +++-- .../details/history/MeasureHistory.js | 3 ++- .../details/treemap/MeasureTreemap.js | 6 +++--- .../component-measures/home/AllMeasuresDomain.js | 5 ++++- .../main/js/apps/component-measures/home/Home.js | 4 ++-- .../component-measures/home/HomeMeasuresList.js | 3 ++- .../js/apps/component-measures/home/MeasuresList.js | 3 ++- .../main/js/apps/component-measures/home/reducer.js | 3 ++- .../src/main/js/apps/issues/facets/author-facet.js | 2 +- .../js/apps/issues/facets/custom-values-facet.js | 2 +- .../main/js/apps/issues/facets/language-facet.js | 2 +- .../src/main/js/apps/issues/facets/project-facet.js | 2 +- .../src/main/js/apps/issues/facets/rule-facet.js | 2 +- .../src/main/js/apps/issues/facets/tag-facet.js | 2 +- .../issues/templates/facets/issues-mode-facet.hbs | 4 ++-- .../apps/issues/templates/issues-workspace-home.hbs | 2 +- .../quality-gates/components/AddConditionForm.js | 6 +++--- .../js/apps/quality-gates/components/Condition.js | 4 ++-- .../js/apps/quality-gates/components/Conditions.js | 4 ++-- .../templates/quality-gates-condition-delete.hbs | 2 +- .../views/gate-conditions-delete-view.js | 4 +++- .../templates/quality-profile-comparison.hbs | 2 +- .../templates/quality-profiles-intro.hbs | 5 ++--- .../src/main/js/apps/web-api/components/Search.js | 2 +- .../js/components/SelectList/templates/list.hbs | 2 +- .../issue/templates/issue-assign-form.hbs | 2 +- .../components/issue/templates/issue-tags-form.hbs | 2 +- .../src/main/js/components/select-list/controls.js | 3 ++- server/sonar-web/src/main/js/helpers/l10n.js | 12 ++++++++++++ .../main/resources/org/sonar/l10n/core.properties | 10 ++++++++++ 33 files changed, 85 insertions(+), 45 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js index 86044f9de8f..fb373856470 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.js +++ b/server/sonar-web/src/main/js/apps/code/components/Search.js @@ -22,7 +22,7 @@ import { connect } from 'react-redux'; 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 () { @@ -78,7 +78,7 @@ class Search extends Component { className={inputClassName} type="search" name="q" - placeholder="Search" + placeholder={translate('search_verb')} maxLength="100" autoComplete="off"/>
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js index 2f51e605e65..bb5e925bc73 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js @@ -26,6 +26,7 @@ import { getComponentLeaves } from '../../../../api/components'; 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; @@ -168,9 +169,15 @@ export default class BubbleChart extends React.Component { {this.renderBubbleChart()}
-
{this.xMetric.name}
-
{this.yMetric.name}
-
Size: {this.sizeMetric.name}
+
+ {getLocalizedMetricName(this.xMetric)} +
+
+ {getLocalizedMetricName(this.yMetric)} +
+
+ {translateWithParameters('component_measures.legend.size_x', getLocalizedMetricName(this.sizeMetric))} +
); } diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js index bc0d5a5f31b..67063af2737 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/MeasureDetailsHeader.js @@ -25,12 +25,13 @@ import LeakPeriodLegend from '../components/LeakPeriodLegend'; 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 (

- {metric.name} + {getLocalizedMetricName(metric)}

{isDiffMetric(metric) && ( diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js index c9df13a2482..ff6b063441b 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentsList.js @@ -22,6 +22,7 @@ import React from 'react'; 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) { @@ -39,11 +40,11 @@ const ComponentsList = ({ components, metrics, selected, metric, onClick }) => {   - {metric.name} + {getLocalizedMetricName(metric)} {otherMetrics.map(metric => ( - {metric.name} + {getLocalizedMetricName(metric)} ))} diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js index 22c72923f43..2370fce1031 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js @@ -26,6 +26,7 @@ import Timeline from '../../../../components/charts/Timeline'; 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; @@ -162,7 +163,7 @@ export default class MeasureHistory extends React.Component { return (
- There is no historical data. + {translate('component_measures.no_history')}
); diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js index 7b75d0b65f5..1fe61d36ec9 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js @@ -24,7 +24,7 @@ import { getLeakValue } from '../../utils'; 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'; @@ -93,7 +93,7 @@ export default class MeasureTreemap extends React.Component { 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('
'); return `
${inner}
`; @@ -213,7 +213,7 @@ export default class MeasureTreemap extends React.Component {
  • - {translateWithParameters('component_measures.legend.color_x', metric.name)} + {translateWithParameters('component_measures.legend.color_x', getLocalizedMetricName(metric))}
  • {translateWithParameters('component_measures.legend.size_x', translate('metric.ncloc.name'))} diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js index 8403346f9ec..6f14109c27a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/AllMeasuresDomain.js @@ -20,6 +20,7 @@ import React from 'react'; import HomeMeasuresList from './HomeMeasuresList'; +import { getLocalizedMetricDomain } from '../../../helpers/l10n'; export default class AllMeasuresDomain extends React.Component { render () { @@ -29,7 +30,9 @@ export default class AllMeasuresDomain extends React.Component {
  • {displayHeader && (
    -

    {domain.name}

    +

    + {getLocalizedMetricDomain(domain.name)} +

    )} diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/Home.js b/server/sonar-web/src/main/js/apps/component-measures/home/Home.js index a68619568c1..84b8dabece3 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/Home.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/Home.js @@ -22,7 +22,7 @@ import { Link, IndexLink } from 'react-router'; 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 () { @@ -61,7 +61,7 @@ export default class Home extends React.Component { - {domain.name} + {getLocalizedMetricDomain(domain.name)}
  • ))} diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js b/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js index d8eaa2bf8fe..921a24f9f03 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/HomeMeasuresList.js @@ -23,12 +23,13 @@ import sortBy from 'lodash/sortBy'; 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)) ]; } diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js b/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js index 9ed099b4924..95a0ac857a8 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/MeasuresList.js @@ -21,6 +21,7 @@ import React from 'react'; import { Link } from 'react-router'; import MeasureListValue from './MeasureListValue'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; const MeasuresList = ({ measures, component, className = 'domain-measures' }) => { return ( @@ -32,7 +33,7 @@ const MeasuresList = ({ measures, component, className = 'domain-measures' }) =>
    - {measure.metric.name} + {getLocalizedMetricName(measure.metric)}
    diff --git a/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js b/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js index 9d0cfafb1f5..757889e6860 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js +++ b/server/sonar-web/src/main/js/apps/component-measures/home/reducer.js @@ -23,6 +23,7 @@ import sortBy from 'lodash/sortBy'; import toPairs from 'lodash/toPairs'; import { RECEIVE_MEASURES } from './actions'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; const initialState = { measures: undefined, @@ -36,7 +37,7 @@ function groupByDomains (measures) { 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'); diff --git a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js index 448922fa23d..bdb039f805a 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/author-facet.js @@ -27,7 +27,7 @@ export default CustomValuesFacet.extend({ prepareSearch () { return this.$('.js-custom-value').select2({ - placeholder: 'Search...', + placeholder: translate('search_verb'), minimumInputLength: 2, allowClear: false, formatNoMatches () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/custom-values-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/custom-values-facet.js index 170d96111fa..225d193a241 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/custom-values-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/custom-values-facet.js @@ -42,7 +42,7 @@ export default BaseFacet.extend({ prepareSearch () { return this.$('.js-custom-value').select2({ - placeholder: 'Search...', + placeholder: translate('search_verb'), minimumInputLength: 2, allowClear: false, formatNoMatches () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js index 38164faed8f..ab9b6671c0e 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/language-facet.js @@ -28,7 +28,7 @@ export default CustomValuesFacet.extend({ prepareSearch () { return this.$('.js-custom-value').select2({ - placeholder: 'Search...', + placeholder: translate('search_verb'), minimumInputLength: 2, allowClear: false, formatNoMatches () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js index 5b1eaf2bfd0..bc6e193242c 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/project-facet.js @@ -44,7 +44,7 @@ export default CustomValuesFacet.extend({ 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 () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js index 9cd5a702385..343fa489e1c 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/rule-facet.js @@ -29,7 +29,7 @@ export default CustomValuesFacet.extend({ url += '&languages=' + languages; } return this.$('.js-custom-value').select2({ - placeholder: 'Search...', + placeholder: translate('search_verb'), minimumInputLength: 2, allowClear: false, formatNoMatches () { diff --git a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js index 1e41af86e4e..6bf0055b685 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/tag-facet.js @@ -29,7 +29,7 @@ export default CustomValuesFacet.extend({ url += '&tags=' + tags; } return this.$('.js-custom-value').select2({ - placeholder: 'Search...', + placeholder: translate('search_verb'), minimumInputLength: 0, allowClear: false, formatNoMatches () { diff --git a/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs b/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs index bfbce223cf7..26dc6a0a5ab 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/facets/issues-mode-facet.hbs @@ -3,12 +3,12 @@
  • - +
  • - +
diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs index 0057630ed6a..fe32b6b8b21 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-home.hbs @@ -21,6 +21,6 @@ diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js b/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js index e9cf133c2b0..02722807a43 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/AddConditionForm.js @@ -21,7 +21,7 @@ import _ from 'underscore'; 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) { @@ -36,7 +36,7 @@ export default function AddConditionForm ({ metrics, onSelect }) { const options = sortedMetrics.map(metric => { return { value: metric.key, - label: metric.name, + label: getLocalizedMetricName(metric), domain: metric.domain }; }); @@ -48,7 +48,7 @@ export default function AddConditionForm ({ metrics, onSelect }) { if (!previous || previous.domain !== option.domain) { optionsWithDomains.push({ value: option.domain, - label: option.domain, + label: getLocalizedMetricDomain(option.domain), disabled: true }); } diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js index 0e91e67d440..385bf06fc2e 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js @@ -23,7 +23,7 @@ import Select from 'react-select'; 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 { @@ -162,7 +162,7 @@ export default class Condition extends Component { return ( - {metric.name} + {getLocalizedMetricName(metric)} {metric.hidden && ( {translate('deprecated')} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js index 8281bf0541b..50f0244c683 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js @@ -24,7 +24,7 @@ import uniqBy from 'lodash/uniqBy'; 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}`; @@ -107,7 +107,7 @@ export default class Conditions extends React.Component {

{translate('quality_gates.duplicated_conditions')}

    {uniqDuplicates.map(d => ( -
  • {d.metric.name}
  • +
  • {getLocalizedMetricName(d.metric)}
  • ))}
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-condition-delete.hbs b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-condition-delete.hbs index 221d0380016..5ca1ac2944c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-condition-delete.hbs +++ b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-condition-delete.hbs @@ -4,7 +4,7 @@ diff --git a/server/sonar-web/src/main/js/components/issue/templates/issue-assign-form.hbs b/server/sonar-web/src/main/js/components/issue/templates/issue-assign-form.hbs index 9509d787163..64d2d0d7166 100644 --- a/server/sonar-web/src/main/js/components/issue/templates/issue-assign-form.hbs +++ b/server/sonar-web/src/main/js/components/issue/templates/issue-assign-form.hbs @@ -2,7 +2,7 @@ - + diff --git a/server/sonar-web/src/main/js/components/issue/templates/issue-tags-form.hbs b/server/sonar-web/src/main/js/components/issue/templates/issue-tags-form.hbs index 9509d787163..64d2d0d7166 100644 --- a/server/sonar-web/src/main/js/components/issue/templates/issue-tags-form.hbs +++ b/server/sonar-web/src/main/js/components/issue/templates/issue-tags-form.hbs @@ -2,7 +2,7 @@ - + diff --git a/server/sonar-web/src/main/js/components/select-list/controls.js b/server/sonar-web/src/main/js/components/select-list/controls.js index 35e6d2456a3..47877eae26e 100644 --- a/server/sonar-web/src/main/js/components/select-list/controls.js +++ b/server/sonar-web/src/main/js/components/select-list/controls.js @@ -20,6 +20,7 @@ import _ from 'underscore'; import React from 'react'; import RadioToggle from '../shared/radio-toggle'; +import { translate } from '../../helpers/l10n'; export default React.createClass({ componentWillMount() { @@ -68,7 +69,7 @@ export default React.createClass({ onChange={this.search} ref="search" type="search" - placeholder="Search" + placeholder={translate('search_verb')} initialValue={this.props.query}/> diff --git a/server/sonar-web/src/main/js/helpers/l10n.js b/server/sonar-web/src/main/js/helpers/l10n.js index 0744ede3acf..4327acd30e6 100644 --- a/server/sonar-web/src/main/js/helpers/l10n.js +++ b/server/sonar-web/src/main/js/helpers/l10n.js @@ -95,3 +95,15 @@ export function getLocalizedDashboardName (baseName) { 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; +} diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index ecbf7655cae..45971557aeb 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -182,6 +182,7 @@ version=Version view=View views=Views violations=Violations +with=With @@ -728,6 +729,7 @@ issues.home.my_filters=My Filters 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 @@ -836,6 +838,8 @@ issues.facet.createdAt.last_month=Last month 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 #------------------------------------------------------------------------------ @@ -1751,6 +1755,8 @@ quality_profiles.projects.select_hint=Click to associate this project with the q 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. @@ -2202,6 +2208,9 @@ metric_domain.SCM=SCM metric_domain.Maintainability=Maintainability metric_domain.Reliability=Reliability metric_domain.Security=Security +metric_domain.Issues=Issues +metric_domain.Duplications=Duplications +metric_domain.Coverage=Coverage #------------------------------------------------------------------------------ @@ -3176,3 +3185,4 @@ component_measures.tab.history=History 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. -- 2.39.5