From: Yuri Weinstein Date: Wed, 20 Nov 2019 20:03:02 +0000 (-0800) Subject: Merge pull request #30910 from rjfd/wip-42283-nautilus X-Git-Tag: v14.2.5~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f62e838b97df12dd1a8fa3c7cf2654bef5b83d9;p=ceph.git Merge pull request #30910 from rjfd/wip-42283-nautilus nautilus: mgr/dashboard: internationalization support with AOT enabled Reviewed-by: Lenz Grimmer Reviewed-by: Sebastian Krah Reviewed-by: Laura Paduano Reviewed-by: Ernesto Puerta --- 2f62e838b97df12dd1a8fa3c7cf2654bef5b83d9 diff --cc src/pybind/mgr/dashboard/frontend/package-lock.json index c3a0bda113b8,78b5668ca276..0b3138462d97 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@@ -13093,54 -14641,26 +13193,65 @@@ } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.4.3", + "function-bind": "^1.0.2" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", diff --cc src/pybind/mgr/dashboard/frontend/package.json index c0f3ed010719,e1f493b24aef..695c8898b028 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@@ -6,13 -9,21 +9,26 @@@ "ng": "ng", "start": "npm run env_build && ng serve --host 0.0.0.0", "build": "npm run env_build && ng build", + "build-i18n": "export _locale=${LOCALE:-$npm_package_config_locale}; [ -f src/locale/messages.${_locale}.xlf ] && npm run build -- --outputPath=dist/${_locale} --i18nFile=src/locale/messages.${_locale}.xlf --i18nLocale=${_locale}", + "build:en-US": "LOCALE=en-US npm run build-i18n", + "build:de-DE": "LOCALE=de-DE npm run build-i18n", + "build:es-ES": "LOCALE=es-ES npm run build-i18n", + "build:pt-BR": "LOCALE=pt-BR npm run build-i18n", + "build:it-IT": "LOCALE=it-IT npm run build-i18n", + "build:cs": "LOCALE=cs npm run build-i18n", + "build:fr-FR": "LOCALE=fr-FR npm run build-i18n", + "build:id-ID": "LOCALE=id-ID npm run build-i18n", + "build:ja-JP": "LOCALE=ja-JP npm run build-i18n", + "build:pl-PL": "LOCALE=pl-PL npm run build-i18n", + "build:zh-CN": "LOCALE=zh-CN npm run build-i18n", + "build:zh-TW": "LOCALE=zh-TW npm run build-i18n", "env_build": "cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts && node ./environment.build.js", - "i18n": "ng xi18n --i18n-format xlf --i18n-locale en-US --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US", + "i18n": "npm run i18n:extract && npm run i18n:push && npm run i18n:pull && npm run i18n:merge", + "i18n:extract": "ng xi18n --i18n-format xlf --i18n-locale en-US --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US", + "i18n:push": "npx i18ntool push -c i18n.config.json", + "i18n:pull": "npx i18ntool pull -c i18n.config.json", + "i18n:merge": "npx i18ntool merge -c i18n.config.json", + "i18n:token": "npx i18ntool config token", "test": "npm run test:config && jest --watch", "test:ci": "npm run test:config && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter", "test:config": "if [ ! -e 'src/unit-test-configuration.ts' ]; then cp 'src/unit-test-configuration.ts.sample' 'src/unit-test-configuration.ts'; fi", @@@ -112,9 -122,9 +128,10 @@@ "jest-preset-angular": "6.0.2", "jest-silent-reporter": "0.1.2", "prettier": "1.16.4", + "npm-run-all": "^4.1.5", "protractor": "5.4.2", "replace-in-file": "3.4.3", + "transifex-i18ntool": "1.1.0", "ts-node": "8.0.2", "tslint": "5.18.0", "typescript": "3.2.4"