From: Volker Theile Date: Wed, 13 May 2020 06:08:48 +0000 (+0200) Subject: mgr/dashboard: Fix I18N errors X-Git-Tag: v14.2.10~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a461eeb918e691cd359bc822530824ac767bc07c;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 (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 --- 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