]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Use default language when running "npm run build" 33668/head
authorTiago Melo <tspmelo@gmail.com>
Tue, 12 Nov 2019 11:08:40 +0000 (10:08 -0100)
committerErnesto Puerta <epuertat@redhat.com>
Mon, 2 Mar 2020 16:14:20 +0000 (17:14 +0100)
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 <tmelo@suse.com>
(cherry picked from commit 360b616c1224e0eef4b3d163ebae74d8d45b8d9a)

src/pybind/mgr/dashboard/frontend/package.json

index 695c8898b028e193f27006c456b1b2bbab425d46..1a19ef8805e04d9979ba75cdffb700b937126541 100644 (file)
@@ -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",