]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix I18N errors 34949/head
authorTiago Melo <tmelo@suse.com>
Thu, 7 May 2020 11:44:47 +0000 (11:44 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 7 May 2020 12:14:56 +0000 (12:14 +0000)
We were just checking if the translation sources were correct and ignore if the
extraction simply failed.

Fixes: https://tracker.ceph.com/issues/45428
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts
src/pybind/mgr/dashboard/run-frontend-unittests.sh

index b258d2c18696d3713b9d7c2cc95e0d2d428e31f1..af7eacd4ff9b3b98c55c5adb7527aa1c953e4743 100644 (file)
@@ -147,9 +147,11 @@ export class TelemetryComponent implements OnInit {
     this.mgrModuleService.updateConfig('telemetry', config).subscribe(
       () => {
         this.disableModule(
-          'Your settings have been applied successfully. ' +
-            'Due to privacy/legal reasons the Telemetry module is now disabled until you ' +
-            'complete the next step and accept the license.',
+          this.i18n(
+            `Your settings have been applied successfully. \
+Due to privacy/legal reasons the Telemetry module is now disabled until you \
+complete the next step and accept the license.`
+          ),
           () => {
             this.getReport();
           }
@@ -169,7 +171,7 @@ export class TelemetryComponent implements OnInit {
   disableModule(message: string = null, followUpFunc: Function = null) {
     this.telemetryService.enable(false).subscribe(() => {
       if (message) {
-        this.notificationService.show(NotificationType.success, this.i18n(message));
+        this.notificationService.show(NotificationType.success, message);
       }
       if (followUpFunc) {
         followUpFunc();
index d530e3462fb3d6cab877071ca9c1e0a2c74c8242..4bccee8c4d92263fd96714147bcd3cd259f41f38 100644 (file)
@@ -58,10 +58,9 @@ export class SmartListComponent implements OnInit, OnChanges {
         let userMessage = '';
         if (smartData.smartctl_error_code === -22) {
           userMessage = this.i18n(
-            'Smartctl has received an unknown argument (error code ' +
-              '{{code}}). You may be using an ' +
-              'incompatible version of smartmontools. Version >= 7.0 of ' +
-              'smartmontools is required to successfully retrieve data.',
+            `Smartctl has received an unknown argument (error code {{code}}). \
+You may be using an incompatible version of smartmontools. Version >= 7.0 of \
+smartmontools is required to successfully retrieve data.`,
             { code: smartData.smartctl_error_code }
           );
         } else {
index 5a3d4ccb8911952d482a230bb2fc29e56352470c..092770d044b1e2db6c7b54e33cc88e34c4ade727 100644 (file)
         <li routerLinkActive="active"
             class="tc_submenuitem tc_submenuitem_monitoring"
             *ngIf="permissions.prometheus.read">
-          <a i18n
-             routerLink="/monitoring">
+          <a routerLink="/monitoring">
             <ng-container i18n>Monitoring</ng-container>
             <small *ngIf="prometheusAlertService.alerts.length > 0"
                    class="badge badge-danger">{{ prometheusAlertService.alerts.length }}</small>
index 936b19d8293e978f87366d6cf6d7b72b505d7f6b..e3030b10a676682a4ba0272e18f989474848ec77 100644 (file)
@@ -35,11 +35,11 @@ export class PasswordPolicyService {
               'Cannot contain any sequential characters e.g. "abc"'
             ),
             pwdPolicyCheckComplexityEnabled: this.i18n(
-              'Must consist of characters from the following groups:\n' +
-                '  * Alphabetic a-z, A-Z\n' +
-                '  * Numbers 0-9\n' +
-                '  * Special chars: !"#$%& \'()*+,-./:;<=>?@[\\]^_`{{|}}~\n' +
-                '  * Any other characters (signs)'
+              `Must consist of characters from the following groups:
+  * Alphabetic a-z, A-Z
+  * Numbers 0-9
+  * Special chars: !"#$%& '()*+,-./:;<=>?@[\\]^_\`{{|}}~
+  * Any other characters (signs)`
             )
           };
           helpText = helpText.concat(
index 38c47f8e4d779228bdbfb3618b16200f59674baf..c94cd922f545f57b03f9cfbd8d7cb2386550c821 100755 (executable)
@@ -37,12 +37,17 @@ fi
 
 # I18N
 npm run i18n:extract
-i18n_lint=`awk '/<source> |<source>$| <\/source>/,/<\/context-group>/ {printf "%-4s ", NR; print}' src/locale/messages.xlf`
-if [ "$i18n_lint" ]; then
-  echo -e "The following source translations in 'messages.xlf' need to be \
-fixed, please check the I18N suggestions in 'HACKING.rst':\n"
-  echo "${i18n_lint}"
+if [ $? -gt 0 ]; then
   failed=true
+  echo -e "\nTranslations extraction has failed."
+else
+  i18n_lint=`awk '/<source> |<source>$| <\/source>/,/<\/context-group>/ {printf "%-4s ", NR; print}' src/locale/messages.xlf`
+  if [ "$i18n_lint" ]; then
+    echo -e "\nThe following source translations in 'messages.xlf' need to be \
+  fixed, please check the I18N suggestions in 'HACKING.rst':\n"
+    echo "${i18n_lint}"
+    failed=true
+  fi
 fi
 
 # npm resolutions