From: Tiago Melo Date: Thu, 7 May 2020 11:44:47 +0000 (+0000) Subject: mgr/dashboard: Fix I18N errors X-Git-Tag: v17.0.0~2422^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=897e6a352d1623a045801fabcd3ddaa34bf0e498;p=ceph.git mgr/dashboard: Fix I18N errors 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 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts index b258d2c18696d..af7eacd4ff9b3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts @@ -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(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts index d530e3462fb3d..4bccee8c4d922 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts @@ -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 { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html index 5a3d4ccb89119..092770d044b1e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html @@ -155,8 +155,7 @@
  • - + Monitoring {{ prometheusAlertService.alerts.length }} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts index 936b19d8293e9..e3030b10a6766 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts @@ -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( diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh index 38c47f8e4d779..c94cd922f545f 100755 --- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh @@ -37,12 +37,17 @@ fi # I18N npm run i18n:extract -i18n_lint=`awk '/ |$| <\/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>/,/<\/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