i18n Angular index.html does not link to appropriate subfolder

Bug #2032430 reported by Blake GH
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Undecided
Unassigned

Bug Description

Installing Evergreen with different language support revealed an issue with Angular. This command:

ng build --configuration=production

does build the cs-CZ folder as well as the en-US folder. Found in:
../../web/eg2

But the index.html file includes lines like this:

<script src="/eg2/main.eaa9f97ec648c706.js" type="module"></script>

Lacking the locale (cs-CZ) - Evergreen will default to whatever the RewriteRule line is configured for:

RewriteRule ^/eg2/(.*) https://%{HTTP_HOST}/eg2/en-US/$1 [NE,R=307,L]

Therefore, the Angular interfaces will still show en-US, even when the URL on the browser is

/eg2/cs-CZ/staff/splash

tags: added: install-upgrade
tags: added: i18n
Bill Erickson (berick)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Here's a work in progress branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp2032430-ang-locale-build-repairs

It tweaks the angular.json config file to better handle the install location for locales.

It also includes cs-CZ in the environment files, but that's just for testing this branch. We probably don't want to include those by default (though I'm not sure on that).

How I got it working:

---
$ ng build --configuration=production

# Tell cs-CZ's index.html to load the cs-CZ version of the IDL.
# This part only works if the cs-CZ DTD file has been created
# (with make LOCALE=cs-CZ install) and deployed at
# /openils/var/web/opac/locale/cs-CZ/fm_IDL.dtd

$ sed -i s/IDL2js\"/IDL2js?locale=cs-CZ\"/g ../../web/eg2/cs-CZ/index.html
---

Some notes:

1. building in non-production mode does not create the cs-CZ translations. Not sure why.
2. The cs-CZ UI is funky in places. Some strings are just missing, i.e. no fallback en-US translation. Not sure what this is about either.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.