From 360b616c1224e0eef4b3d163ebae74d8d45b8d9a Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Tue, 12 Nov 2019 10:08:40 -0100 Subject: [PATCH] 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 --- .../mgr/dashboard/frontend/package.json | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 3b5d262ffe8..75a70d5d6cd 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", -- 2.39.5