Need to load all the PO files for a locale

Bug #1717777 reported by Ben Shum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned

Bug Description

Evergreen master / and all previous versions with web client

When configuring locales for the catalog and web client, we specify them in the separate Locations of eg_vhost.conf. One is /eg/ (which is where the catalog is) and /eg/staff/ (for the web client).

So for example, it would look something like:

<LocationMatch /eg/>
...
    PerlAddVar OILSWebLocale "fr_ca"
    PerlAddVar OILSWebLocale "/openils/var/data/locale/opac/fr-CA.po"
...
</LocationMatch>

<LocationMatch /eg/staff/>
...
    PerlAddVar OILSWebLocale "fr_ca"
    PerlAddVar OILSWebLocale "/openils/var/data/locale/staff/fr-CA.po"
...
</LocationMatch>

The problem manifests where only one of the PO files gets loaded up for the locale, and so either you end up with only opac strings (missing most of the menu translations and web client functionality, etc.), or you get only the webstaff strings (which leads to an untranslated catalog search in the web client and broken catalog views for cataloging).

Talking to berick on IRC, we isolated the problem to this line in Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm's load_locale_handlers() function (around line 387):

    next if grep { $_ eq $tag } keys %registered_locales;

Commenting out this line allowed us to load more than one PO file to the locale and appeared to fix the loading issue on one of our test servers.

Reporting this bug separately from when it was uncovered in bug 1629078. Fixing this issue would be considered critical to having functional i18n for the web client.

Ben Shum (bshum)
tags: added: apache i18n opac tpac webstaffclient
Changed in evergreen:
milestone: none → 3.0-beta2
status: New → Confirmed
Revision history for this message
Mike Rylander (mrylander) wrote :

I have a branch for this here:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/lp-1717777-load-all-PO-files

From the commit message:

We assumed only one file per locale, but apache <Location>s because are not independent WRT locale helpers in mod_perl, we need to load all files from all <Location> directives for a given locale.

NOTE: there is a risk of translation collision, where the same key string in two PO files have different translations, but in our context that is almost surely a mistake.

tags: added: pullrequest
Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → High
Revision history for this message
Ben Shum (bshum) wrote :

Worked for my refreshed test system. Pushed to master for 3.0-beta2 happiness with i18n. Thanks miker!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
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.