From a461eeb918e691cd359bc822530824ac767bc07c Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Wed, 13 May 2020 08:08:48 +0200 Subject: [PATCH] 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 (cherry picked from commit 897e6a352d1623a045801fabcd3ddaa34bf0e498) Conflicts: src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.html src/pybind/mgr/dashboard/run-frontend-unittests.sh Removed because that files are not available in Nautilus: src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts 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 --- .../navigation/navigation.component.html | 3 +-- .../mgr/dashboard/run-frontend-unittests.sh | 15 ++++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) 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 a61b0581dde..62331bb9112 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 @@ -101,8 +101,7 @@
  • - + Monitoring {{ prometheusAlertService.alerts.length }} diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh index 0186e872d75..dd8bac59a60 100755 --- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh @@ -34,12 +34,17 @@ fi # I18N npm run i18n:extract -i18n_lint=`awk '/ |$| <\/source>/,/<\/context-group>/ {printf "%-4s ", NR; print}' src/locale/messages.xlf` -if [[ ! -z $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 "The 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 if [ `uname` != "FreeBSD" ]; then -- 2.47.3