From: Tiago Melo Date: Fri, 23 Nov 2018 11:32:38 +0000 (+0000) Subject: mgr/dashboard: Add i18n validation script X-Git-Tag: v14.1.0~780^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=091bd4b5b43ef55e7af888561478372dacb3d98e;p=ceph.git mgr/dashboard: Add i18n validation script This will check if there are new strings, validate them and ask the developer to commit and fix those. Signed-off-by: Tiago Melo --- diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 1fbebb6e9e3a..b2d8d8a069ec 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -249,6 +249,10 @@ parse the TypeScript files. When the command ran successfully, it should have created or updated the file ``src/locale/messages.xlf``. +To make sure this file is always up to date in master branch, we added a +validation in ``run-frontend-unittests.sh`` that will fail if it finds +uncommitted translations. + Supported languages ~~~~~~~~~~~~~~~~~~~ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html index 3228d4dc171a..206de6d3ec2b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.html @@ -71,9 +71,7 @@ let-actionDescription="actionDescription">
- - The OSD is not safe to destroy! - + The OSD is not safe to destroy!
OSD {{ selection.first().id }} will be {{ actionDescription }} if you proceed. 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 c26ca1fbbf4e..7b5713515e78 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 @@ -88,8 +88,7 @@ *ngIf="permissions.log.read"> Logs - + routerLink="/logs">Logs diff --git a/src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf b/src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf index 8334dc236c66..890b142d3f1c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf +++ b/src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf @@ -20,10 +20,6 @@ app/core/navigation/navigation/navigation.component.html 46 - - app/ceph/dashboard/health/health.component.html - 262 - Hosts @@ -32,7 +28,7 @@ app/ceph/dashboard/health/health.component.html - 77 + 82 Monitors @@ -66,11 +62,17 @@ app/core/navigation/navigation/navigation.component.html 84 + + Logs + + app/core/navigation/navigation/navigation.component.html + 91 + Pools app/core/navigation/navigation/navigation.component.html - 94 + 101 app/ceph/block/mirroring/mirroring.component.html @@ -78,7 +80,7 @@ app/ceph/dashboard/health/health.component.html - 183 + 191 app/ceph/cephfs/cephfs-detail/cephfs-detail.component.html @@ -88,13 +90,13 @@ Block app/core/navigation/navigation/navigation.component.html - 106 + 113 Images app/core/navigation/navigation/navigation.component.html - 115 + 122 app/ceph/block/iscsi/iscsi.component.html @@ -112,31 +114,31 @@ Mirroring app/core/navigation/navigation/navigation.component.html - 123 + 130 iSCSI app/core/navigation/navigation/navigation.component.html - 135 + 142 Filesystems app/core/navigation/navigation/navigation.component.html - 146 + 153 Object Gateway app/core/navigation/navigation/navigation.component.html - 157 + 164 Daemons app/core/navigation/navigation/navigation.component.html - 166 + 173 app/ceph/block/iscsi/iscsi.component.html @@ -150,7 +152,7 @@ Users app/core/navigation/navigation/navigation.component.html - 172 + 179 app/core/auth/user-tabs/user-tabs.component.html @@ -160,7 +162,7 @@ Buckets app/core/navigation/navigation/navigation.component.html - 178 + 185 Retrieving data for @@ -753,19 +755,31 @@ Overall Performance app/ceph/cluster/hosts/hosts.component.html - 28 + 29 app/ceph/cluster/osd/osd-list/osd-list.component.html - 49 + 50 app/ceph/pool/pool-list/pool-list.component.html - 37 + 39 app/ceph/rgw/rgw-daemon-list/rgw-daemon-list.component.html - 15 + 16 + + + Cluster Logs + + app/ceph/cluster/logs/logs.component.html + 4 + + + Audit Logs + + app/ceph/cluster/logs/logs.component.html + 19 Status @@ -953,14 +967,20 @@ if you proceed. app/ceph/cluster/osd/osd-list/osd-list.component.html - 64 + 65 + + + The OSD is not safe to destroy! + + app/ceph/cluster/osd/osd-list/osd-list.component.html + 74 OSD will be if you proceed. app/ceph/cluster/osd/osd-list/osd-list.component.html - 77 + 76 Health @@ -1484,15 +1504,15 @@ Performance Details app/ceph/pool/pool-list/pool-list.component.html - 26 + 27 app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.html - 15 + 16 app/ceph/cluster/osd/osd-details/osd-details.component.html - 45 + 46 app/ceph/cluster/hosts/host-details/host-details.component.html @@ -1500,7 +1520,7 @@ app/ceph/cephfs/cephfs-detail/cephfs-detail.component.html - 44 + 45 Pools List @@ -1855,7 +1875,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 34 + 39 There are no subusers. @@ -1891,7 +1911,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 128 + 133 S3 @@ -1921,7 +1941,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 143 + 148 Add S3 key @@ -1943,7 +1963,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 43 + 48 There are no capabilities. @@ -1965,7 +1985,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 55 + 60 Enabled @@ -1983,11 +2003,11 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 60 + 65 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 96 + 101 Unlimited size @@ -2041,7 +2061,7 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 91 + 96 Welcome to Ceph! @@ -2351,11 +2371,11 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 65 + 70 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 101 + 106 Unlimited @@ -2369,19 +2389,19 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 68 + 73 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 79 + 84 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 104 + 109 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 115 + 120 Maximum objects @@ -2391,17 +2411,23 @@ app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 76 + 81 app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 112 + 117 + + + System + + app/ceph/rgw/rgw-user-details/rgw-user-details.component.html + 29 Maximum buckets app/ceph/rgw/rgw-user-details/rgw-user-details.component.html - 29 + 34 Performance counters not available @@ -2519,7 +2545,7 @@ app/ceph/dashboard/health/health.component.html - 233 + 241 Cluster Status @@ -2531,73 +2557,73 @@ Manager Daemons app/ceph/dashboard/health/health.component.html - 69 + 70 Object Gateways app/ceph/dashboard/health/health.component.html - 86 + 91 Metadata Servers app/ceph/dashboard/health/health.component.html - 94 + 99 iSCSI Gateways app/ceph/dashboard/health/health.component.html - 102 + 110 Client IOPS app/ceph/dashboard/health/health.component.html - 118 + 126 Client Throughput app/ceph/dashboard/health/health.component.html - 127 + 135 Client Read/Write app/ceph/dashboard/health/health.component.html - 136 + 144 Client Recovery app/ceph/dashboard/health/health.component.html - 154 + 162 Scrub app/ceph/dashboard/health/health.component.html - 163 + 171 Performance app/ceph/dashboard/health/health.component.html - 112 + 120 Raw Capacity app/ceph/dashboard/health/health.component.html - 193 + 201 Objects app/ceph/dashboard/health/health.component.html - 206 + 214 app/ceph/block/rbd-details/rbd-details.component.html @@ -2607,31 +2633,19 @@ PGs per OSD app/ceph/dashboard/health/health.component.html - 215 + 223 PG Status app/ceph/dashboard/health/health.component.html - 224 + 232 Capacity app/ceph/dashboard/health/health.component.html - 174 - - - Audit - - app/ceph/dashboard/health/health.component.html - 276 - - - Logs - - app/ceph/dashboard/health/health.component.html - 256 + 182 Move an image to trash @@ -3882,6 +3896,17 @@ 1 + + up + + src/app/ceph/dashboard/mds-summary.pipe.ts + 1 + + + src/app/ceph/dashboard/osd-summary.pipe.ts + 1 + + no filesystems @@ -3899,6 +3924,10 @@ src/app/ceph/dashboard/mds-summary.pipe.ts 1 + + src/app/ceph/dashboard/mgr-summary.pipe.ts + 1 + standby @@ -3906,25 +3935,29 @@ src/app/ceph/dashboard/mds-summary.pipe.ts 1 + + src/app/ceph/dashboard/mgr-summary.pipe.ts + 1 + - - standbys + + n/a src/app/ceph/dashboard/mgr-summary.pipe.ts 1 - - quorum + + active daemon - src/app/ceph/dashboard/mon-summary.pipe.ts + src/app/ceph/dashboard/mgr-summary.pipe.ts 1 - - up + + quorum - src/app/ceph/dashboard/osd-summary.pipe.ts + src/app/ceph/dashboard/mon-summary.pipe.ts 1 diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh index b01a6acc13be..94ce08a30e6f 100755 --- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh +++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh @@ -32,6 +32,22 @@ if [ $? -gt 0 ]; then Some errors might need a manual fix." fi +# I18N +npm run i18n +i18n_modified=`git status -s src/locale/messages.xlf` +if [[ ! -z $i18n_modified ]]; then + echo "Please run 'npm run i18n' and commit the modified 'messages.xlf' file." + failed=true +fi + +i18n_lint=`grep -En " |$| " 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}" + failed=true +fi + if [ `uname` != "FreeBSD" ]; then deactivate fi