From dc6662dafa9c7a7ed970bb55de05712bf6d2a69f Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Fri, 4 Oct 2019 15:48:41 +0100 Subject: [PATCH] mgr/dashboard: package.json: add build scripts for each language Signed-off-by: Ricardo Dias (cherry picked from commit 4169abc6724723e1033803255df78d25b36243ac) --- src/pybind/mgr/dashboard/frontend/package.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index e5103272acb80..991ca8047680a 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -2,10 +2,26 @@ "name": "ceph-dashboard", "version": "0.0.0", "license": "MIT", + "config": { + "locale": "en-US" + }, "scripts": { "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 -- --i18nFormat=xlf --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", "test": "npm run test:config && jest --watch", -- 2.39.5