]> source.dussan.org Git - sonarqube.git/commitdiff
Fix localization in projects page facets
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 23 May 2017 13:50:18 +0000 (15:50 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Wed, 24 May 2017 08:04:13 +0000 (10:04 +0200)
server/sonar-web/src/main/js/apps/projects/filters/CoverageFilter.js
server/sonar-web/src/main/js/apps/projects/filters/DuplicationsFilter.js
server/sonar-web/src/main/js/apps/projects/filters/IssuesFilter.js
server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.js
server/sonar-web/src/main/js/apps/projects/filters/QualityGateFilter.js
server/sonar-web/src/main/js/apps/projects/filters/SizeFilter.js
server/sonar-web/src/main/js/apps/projects/filters/SortingFilter.js
server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.js
server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/LanguagesFilter-test.js.snap
server/sonar-web/src/main/js/apps/projects/filters/__tests__/__snapshots__/TagsFilter-test.js.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index e914a5180cd075a3e731443dc08798316e458ec1..c29c7f26ec6e0f2b77fb7f6328d07f3ca19816cf 100644 (file)
@@ -23,6 +23,7 @@ import FilterHeader from './FilterHeader';
 import SortingFilter from './SortingFilter';
 import CoverageRating from '../../../components/ui/CoverageRating';
 import { getCoverageRatingLabel, getCoverageRatingAverageValue } from '../../../helpers/ratings';
+import { translate } from '../../../helpers/l10n';
 
 export default class CoverageFilter extends React.PureComponent {
   static propTypes = {
@@ -65,7 +66,7 @@ export default class CoverageFilter extends React.PureComponent {
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
         header={
-          <FilterHeader name="Coverage">
+          <FilterHeader name={translate('metric_domain.Coverage')}>
             <SortingFilter
               property={this.property}
               query={this.props.query}
index c1fed7f07230d48a256e347ab2e90213c1f827eb..e6f2304bc2fe4604696dbb61215474a3b9b40613 100644 (file)
@@ -26,6 +26,7 @@ import {
   getDuplicationsRatingLabel,
   getDuplicationsRatingAverageValue
 } from '../../../helpers/ratings';
+import { translate } from '../../../helpers/l10n';
 
 export default class DuplicationsFilter extends React.PureComponent {
   static propTypes = {
@@ -68,7 +69,7 @@ export default class DuplicationsFilter extends React.PureComponent {
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
         header={
-          <FilterHeader name="Duplications">
+          <FilterHeader name={translate('metric_domain.Duplications')}>
             <SortingFilter
               property={this.property}
               query={this.props.query}
index 96e1a2669e2974987725eb5b91e116c64c150ebb..a287639d59cd1809d1b6a26ce972c4f9f340c170 100644 (file)
@@ -22,6 +22,7 @@ import FilterContainer from './FilterContainer';
 import FilterHeader from './FilterHeader';
 import SortingFilter from './SortingFilter';
 import Rating from '../../../components/ui/Rating';
+import { translate } from '../../../helpers/l10n';
 
 export default class IssuesFilter extends React.PureComponent {
   static propTypes = {
@@ -40,7 +41,9 @@ export default class IssuesFilter extends React.PureComponent {
     return (
       <span>
         <Rating value={option} small={true} muted={!selected} />
-        {option > 1 && option < 5 && <span className="note spacer-left">and worse</span>}
+        {option > 1 &&
+          option < 5 &&
+          <span className="note spacer-left">{translate('and_worse')}</span>}
       </span>
     );
   }
@@ -57,7 +60,7 @@ export default class IssuesFilter extends React.PureComponent {
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
         header={
-          <FilterHeader name={this.props.name}>
+          <FilterHeader name={translate('metric_domain', this.props.name)}>
             <SortingFilter
               property={this.props.property}
               query={this.props.query}
index 47de2131a8f34a8c874d596aa92d360711a4560a..4218dbc3f2631bfc9c8918a6b9c02ba3f835e61e 100644 (file)
@@ -25,6 +25,7 @@ import FilterHeader from './FilterHeader';
 import SearchableFilterFooter from './SearchableFilterFooter';
 import SearchableFilterOption from './SearchableFilterOption';
 import { getLanguageByKey } from '../../../store/languages/reducer';
+import { translate } from '../../../helpers/l10n';
 
 type Props = {
   query: {},
@@ -81,7 +82,7 @@ export default class LanguagesFilter extends React.PureComponent {
         organization={this.props.organization}
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
-        header={<FilterHeader name="Languages" />}
+        header={<FilterHeader name={translate('projects.facets.languages')} />}
         footer={
           <SearchableFilterFooter
             property={this.property}
index d40bd4edf2f4584c4bc4a0227057e0002bd46441..0df574649330ab4d483982db5b4f87fa23dff902 100644 (file)
@@ -21,6 +21,7 @@ import React from 'react';
 import FilterContainer from './FilterContainer';
 import FilterHeader from './FilterHeader';
 import Level from '../../../components/ui/Level';
+import { translate } from '../../../helpers/l10n';
 
 export default class QualityGateFilter extends React.PureComponent {
   static propTypes = {
@@ -48,7 +49,7 @@ export default class QualityGateFilter extends React.PureComponent {
         organization={this.props.organization}
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
-        header={<FilterHeader name="Quality Gate" />}
+        header={<FilterHeader name={translate('projects.facets.quality_gate')} />}
       />
     );
   }
index d97524f25469dbd4ca7e41123b44887e074a74b7..c9cb96b15bc168390966edc1e925fec676638870 100644 (file)
@@ -81,7 +81,7 @@ export default class SizeFilter extends React.PureComponent {
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
         header={
-          <FilterHeader name="Size">
+          <FilterHeader name={translate('metric_domain.Size')}>
             <SortingFilter
               property={this.property}
               query={this.props.query}
index ae97c28785eb051b8ccc9610e357832558a7c989..61f7dfa1262888e433a5bb077b1377b8fc47642e 100644 (file)
@@ -33,10 +33,9 @@ export default class SortingFilter extends React.PureComponent {
     leftText: React.PropTypes.string,
     rightText: React.PropTypes.string
   };
+
   static defaultProps = {
-    sortDesc: 'left',
-    leftText: translate('worst'),
-    rightText: translate('best')
+    sortDesc: 'left'
   };
 
   isSortActive(side) {
@@ -78,13 +77,13 @@ export default class SortingFilter extends React.PureComponent {
             onClick={this.blurLink}
             className={this.getLinkClass('left')}
             to={this.getLinkPath('left')}>
-            {leftText}
+            {leftText || translate('worst')}
           </Link>
           <Link
             onClick={this.blurLink}
             className={this.getLinkClass('right')}
             to={this.getLinkPath('right')}>
-            {rightText}
+            {rightText || translate('best')}
           </Link>
         </div>
       </div>
index c79b7bf2fb82028ba6df22c94ecd0c29a958fa15..05f795cbd50b3e21f6049c387bc4dae4470a4a0d 100644 (file)
@@ -25,6 +25,7 @@ import FilterHeader from './FilterHeader';
 import SearchableFilterFooter from './SearchableFilterFooter';
 import SearchableFilterOption from './SearchableFilterOption';
 import { searchProjectTags } from '../../../api/components';
+import { translate } from '../../../helpers/l10n';
 
 type Props = {
   query: {},
@@ -104,7 +105,7 @@ export default class TagsFilter extends React.PureComponent {
         organization={this.props.organization}
         getFacetValueForOption={this.getFacetValueForOption}
         highlightUnder={1}
-        header={<FilterHeader name="Tags" />}
+        header={<FilterHeader name={translate('projects.facets.tags')} />}
         footer={
           <SearchableFilterFooter
             property={this.property}
index ce37370ca0f9344a3d87f677bfb6e3f1e0cb3e0b..1605a2de8106aa360667048f03e7e9ac973667df 100644 (file)
@@ -77,7 +77,7 @@ exports[`should render maximum 10 languages in the searchbox results 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Languages"
+      name="projects.facets.languages"
     />
   }
   highlightUnder={1}
@@ -157,7 +157,7 @@ exports[`should render the languages facet with the selected languages 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Languages"
+      name="projects.facets.languages"
     />
   }
   highlightUnder={1}
@@ -194,7 +194,7 @@ exports[`should render the languages facet with the selected languages 2`] = `
   data-key="languages"
 >
   <FilterHeader
-    name="Languages"
+    name="projects.facets.languages"
   />
   <div
     className="search-navigator-facet-list"
@@ -379,7 +379,7 @@ exports[`should render the languages without the ones in the facet 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Languages"
+      name="projects.facets.languages"
     />
   }
   highlightUnder={1}
index aeaa01f2554b2634da2909c6706d7ed676b82300..1cadc1ba2e89ec4ce31724a77085fd9e95b85671 100644 (file)
@@ -80,7 +80,7 @@ exports[`should render maximum 10 tags in the searchbox results 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Tags"
+      name="projects.facets.tags"
     />
   }
   highlightUnder={1}
@@ -148,7 +148,7 @@ exports[`should render the tags facet with the selected tags 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Tags"
+      name="projects.facets.tags"
     />
   }
   highlightUnder={1}
@@ -185,7 +185,7 @@ exports[`should render the tags facet with the selected tags 2`] = `
   data-key="tags"
 >
   <FilterHeader
-    name="Tags"
+    name="projects.facets.tags"
   />
   <div
     className="search-navigator-facet-list"
@@ -328,7 +328,7 @@ exports[`should render the tags without the ones in the facet 1`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Tags"
+      name="projects.facets.tags"
     />
   }
   highlightUnder={1}
@@ -396,7 +396,7 @@ exports[`should render the tags without the ones in the facet 2`] = `
   halfWidth={false}
   header={
     <FilterHeader
-      name="Tags"
+      name="projects.facets.tags"
     />
   }
   highlightUnder={1}
index 1ed38b49f5f74879fb7cd2e223c011ef65097c74..aba765f0df23029ba05db1f02f41c900f97f7634 100644 (file)
@@ -221,7 +221,7 @@ added_since_previous_version_detailed=Added since previous version ({0})
 added_since_version=Added since version {0}
 all_violations=All violations
 all_issues=All issues
-apply_template
+and_worse=and worse
 are_you_sure=Are you sure?
 assigned_to=Assigned to
 bulk_change=Bulk Change
@@ -878,6 +878,9 @@ projects.visualization.coverage.description=See missing test coverage's long-ter
 projects.visualization.duplications=Duplications
 projects.visualization.duplications.description=See duplications' long-term risks to your projects. Bubble size indicates the volume of duplicated blocks in the project, and each bubble's vertical position reflects the volume of lines in those blocks. Small bubbles on the bottom edge are best.
 projects.limited_set_of_projects=Displayed project set limited to the top {0} projects based on current sort: {1}.
+projects.facets.quality_gate=Quality Gate
+projects.facets.languages=Languages
+projects.facets.tags=Tags
 projects.sort.name=by name
 projects.sort.reliability=by reliability (best first)
 projects.sort.-reliability=by reliability (worst first)
@@ -2803,7 +2806,6 @@ component_measures.not_found=The requested measure was not found.
 # ABOUT PAGE
 #
 #------------------------------------------------------------------------------
-about_page.read_documentation.
 about_page.projects_analyzed=Projects Analyzed
 about_page.issues_found=Issues Found
 about_page.read_more=Read More