]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: package.json: add build scripts for each language
authorRicardo Dias <rdias@suse.com>
Fri, 4 Oct 2019 14:48:41 +0000 (15:48 +0100)
committerRicardo Dias <rdias@suse.com>
Thu, 10 Oct 2019 14:30:54 +0000 (15:30 +0100)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/mgr/dashboard/frontend/package.json

index 526fd63532a30cd8d462a979b202c8b02e85c255..fc08a17f4aa9ea63ca7821c050a01d8458d47125 100644 (file)
@@ -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": "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",