summaryrefslogtreecommitdiffstats
path: root/src/pybind
diff options
context:
space:
mode:
authorTiago Melo <tmelo@suse.com>2020-05-07 13:44:47 +0200
committerTiago Melo <tmelo@suse.com>2020-05-07 14:14:56 +0200
commit897e6a352d1623a045801fabcd3ddaa34bf0e498 (patch)
treecd821e4dca0be4f7c7e3b8075e03237e8b6abd9d /src/pybind
parentMerge pull request #34855 from s0nea/wip-dashboard-troubleshooting (diff)
downloadceph-897e6a352d1623a045801fabcd3ddaa34bf0e498.tar.xz
ceph-897e6a352d1623a045801fabcd3ddaa34bf0e498.zip
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 <tmelo@suse.com>
Diffstat (limited to 'src/pybind')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts10
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts7
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html3
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts10
-rwxr-xr-xsrc/pybind/mgr/dashboard/run-frontend-unittests.sh15
5 files changed, 25 insertions, 20 deletions
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 b258d2c1869..af7eacd4ff9 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 d530e3462fb..4bccee8c4d9 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 5a3d4ccb891..092770d044b 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 @@
<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>
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 936b19d8293..e3030b10a67 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 38c47f8e4d7..c94cd922f54 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> |<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