From: Tiago Melo Date: Tue, 12 Nov 2019 11:08:40 +0000 (-0100) Subject: mgr/dashboard: Use default language when running "npm run build" X-Git-Tag: v14.2.10~208^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F33668%2Fhead;p=ceph.git mgr/dashboard: Use default language when running "npm run build" This allow us to simply run "npm run build" and it will compile the frontend with "en-US" as the default language and in the correct "dist/en-US" folder. Signed-off-by: Tiago Melo (cherry picked from commit 360b616c1224e0eef4b3d163ebae74d8d45b8d9a) --- diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 695c8898b028..1a19ef8805e0 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -8,20 +8,20 @@ "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 -- --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", + "build": "export _locale=${LOCALE:-$npm_package_config_locale}; ng build --outputPath=dist/${_locale} --i18nFile=src/locale/messages.${_locale}.xlf --i18nLocale=${_locale}", + "prebuild": "npm run env_build", + "build:en-US": "LOCALE=en-US npm run build", + "build:de-DE": "LOCALE=de-DE npm run build", + "build:es-ES": "LOCALE=es-ES npm run build", + "build:pt-BR": "LOCALE=pt-BR npm run build", + "build:it-IT": "LOCALE=it-IT npm run build", + "build:cs": "LOCALE=cs npm run build", + "build:fr-FR": "LOCALE=fr-FR npm run build", + "build:id-ID": "LOCALE=id-ID npm run build", + "build:ja-JP": "LOCALE=ja-JP npm run build", + "build:pl-PL": "LOCALE=pl-PL npm run build", + "build:zh-CN": "LOCALE=zh-CN npm run build", + "build:zh-TW": "LOCALE=zh-TW npm run build", "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": "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",