]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7878 Update pluralization
authorSiegfried Ehret <siegfried.ehret@sonarsource.com>
Thu, 11 Jul 2019 09:24:10 +0000 (11:24 +0200)
committerSonarTech <sonartech@sonarsource.com>
Mon, 22 Jul 2019 18:21:09 +0000 (20:21 +0200)
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavWarnings-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 0538a14ef2480db67500dc42ab6be4bca23e8d9c..d37b6f06ccd7590d1c8da90a497d15ec9a596a1f 100644 (file)
@@ -21,7 +21,7 @@ import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import WarningIcon from 'sonar-ui-common/components/icons/WarningIcon';
 import { lazyLoad } from 'sonar-ui-common/components/lazyLoad';
-import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
+import { translate } from 'sonar-ui-common/helpers/l10n';
 
 const AnalysisWarningsModal = lazyLoad(() =>
   import('../../../../components/common/AnalysisWarningsModal')
@@ -54,15 +54,18 @@ export default class ComponentNavWarnings extends React.PureComponent<Props, Sta
         <div className="badge badge-focus badge-medium display-inline-flex-center js-component-analysis-warnings flex-1">
           <WarningIcon className="spacer-right" />
           <FormattedMessage
-            defaultMessage={translate('component_navigation.last_analsys_had_warnings')}
-            id="component_navigation.last_analsys_had_warnings"
+            defaultMessage={translate('component_navigation.last_analysis_had_warnings')}
+            id="component_navigation.last_analysis_had_warnings"
             values={{
               warnings: (
                 <a href="#" onClick={this.handleClick}>
-                  {translateWithParameters(
-                    'component_navigation.x_warnings',
-                    String(this.props.warnings.length)
-                  )}
+                  <FormattedMessage
+                    defaultMessage={translate('component_navigation.x_warnings')}
+                    id="component_navigation.x_warnings"
+                    values={{
+                      warningsCount: this.props.warnings.length
+                    }}
+                  />
                 </a>
               )
             }}
index 443b65056015e72803b638071317cf8f237cff07..c4d0380903f1d9b39fca754b745b65ebe94cea85 100644 (file)
@@ -9,15 +9,23 @@ exports[`should render 1`] = `
       className="spacer-right"
     />
     <FormattedMessage
-      defaultMessage="component_navigation.last_analsys_had_warnings"
-      id="component_navigation.last_analsys_had_warnings"
+      defaultMessage="component_navigation.last_analysis_had_warnings"
+      id="component_navigation.last_analysis_had_warnings"
       values={
         Object {
           "warnings": <a
             href="#"
             onClick={[Function]}
           >
-            component_navigation.x_warnings.1
+            <FormattedMessage
+              defaultMessage="component_navigation.x_warnings"
+              id="component_navigation.x_warnings"
+              values={
+                Object {
+                  "warningsCount": 1,
+                }
+              }
+            />
           </a>,
         }
       }
index 5db376440ccfa3e557a5e03777b67d5a94e67a44..8f74212b0ef6400113f2609dd3db71021093bab2 100644 (file)
@@ -2339,8 +2339,9 @@ component_navigation.status.in_progress=The analysis is in progress.
 component_navigation.status.in_progress.admin=The analysis is in progress. More details available on the {url} page.
 component_navigation.status.last_blocked_due_to_bad_license=Last analysis blocked due to an invalid license, which has since been corrected. Please reanalyze this project.
 
-component_navigation.last_analsys_had_warnings=Last analysis had {warnings}
-component_navigation.x_warnings={0} warnings
+component_navigation.last_analysis_had_warnings=Last analysis had {warnings}
+component_navigation.x_warnings={warningsCount} {warningsCount, plural, one {warning} other {warnings}}
+
 
 background_task.status.ALL=All
 background_task.status.PENDING=Pending