LP1982887: Repair translations for eg2 client
authorJason Boyer <JBoyer@equinoxOLI.org>
Wed, 27 Jul 2022 22:07:59 +0000 (18:07 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 1 Nov 2022 19:10:03 +0000 (15:10 -0400)
Previously following the build instructions for the Czech localization
placed the results in eg2/cs-CZ/cs-CZ and also broke the en-US build.
These changes bring the staff client a little more in line with current
Angular localization methods.

Note that currently both en-US and cs-CZ are always built. This can be
limited to en-US by using "--localize false" on the ng build command line.
Until an alternative method to determine the number of available locales is
implemented the only way to hide the locale selector is to edit environment.prod.ts.

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: Linda Jansova <skolkova@chello.cz>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/angular.json
Open-ILS/src/eg2/src/environments/environment.prod.ts
build/tools/make_release

index 4c1de91..4ca6e08 100644 (file)
@@ -7,15 +7,24 @@
       "root": "",
       "sourceRoot": "src",
       "projectType": "application",
+      "i18n": {
+        "sourceLocale": "en-US",
+        "locales": {
+          "cs-CZ": {
+            "translation": "src/locale/messages.cs-CZ.xtb"
+          }
+        }
+      },
       "architect": {
         "build": {
           "builder": "@angular-devkit/build-angular:browser",
           "options": {
-            "baseHref": "/eg2/en-US",
-            "deployUrl": "/eg2/en-US/",
-            "outputPath": "../../web/eg2/en-US",
+            "baseHref": "/eg2/",
+            "deployUrl": "/eg2/",
+            "outputPath": "../../web/eg2/",
             "index": "src/index.html",
             "main": "src/main.ts",
+            "localize": true,
             "tsConfig": "src/tsconfig.app.json",
             "polyfills": "src/polyfills.ts",
             "assets": [
                   "with": "src/environments/environment.prod.ts"
                 }
               ]
-            },
-            "production-cs-CZ": {
-              "optimization": true,
-              "outputHashing": "all",
-              "sourceMap": false,
-              "namedChunks": false,
-              "aot": true,
-              "extractLicenses": true,
-              "vendorChunk": false,
-              "buildOptimizer": true,
-              "i18nMissingTranslation": "ignore",
-              "fileReplacements": [
-                {
-                  "replace": "src/environments/environment.ts",
-                  "with": "src/environments/environment.prod.ts"
-                }
-              ],
-              "localize": [
-                "cs-CZ"
-              ]
             }
           },
           "defaultConfiguration": ""
             ]
           }
         }
-      },
-      "i18n": {
-        "locales": {
-          "cs-CZ": {
-            "translation": "src/locale/messages.cs-CZ.xtb",
-            "baseHref": ""
-          }
-        }
       }
     },
     "eg-e2e": {
index d7953f9..aa207e6 100644 (file)
@@ -2,5 +2,5 @@ export const environment = {
   production: true,
   // TODO: a way to pass these in at build time.
   // locales: ['en-US', 'fr-CA', 'cs-CZ']
-  locales: ['en-US']
+  locales: ['en-US', 'cs-CZ']
 };
index 19d1cf9..1540238 100755 (executable)
@@ -355,7 +355,7 @@ if [ "$BUILD_BROWSER_CLIENT" == "YES" ]; then
     echo "Building Angular browser staff client"
     cd src/eg2
     npm install   # fetch build dependencies
-    ng build --prod
+    ng build --configuration production --localize true
     # npm cache is big and unnecessary in the final build. remove it.
     rm -rf node_modules 
     cd ../../../../ # release dir