I18N for ils_events.xml

Bug #1251347 reported by Jason Etheridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

Warning: I may have of all this wrong from my ignorance with I18N and local configuration, but this how things seem to be:

The TPAC has a file, hold_error_messages.tt2, where it maps the event PATRON_EXCEEDS_FINES to a localized string within the template, yet the event itself is defined in the file ils_events.xml which can potentially hold translated text for the event description field. It would be nice if the localized description would propagate through the system whenever the locale was known, so that, for example, the TPAC (and staff client) would not have to handle the localization on its end.

Another example.

My ils_events.xml file contains the following entry:

    <event code='1707' textcode='HOLD_EXISTS'>
        <desc xml:lang="en-US">User already has an open hold on the selected item</desc>
        <desc xml:lang="fr-CA">uSER ALREADY HAS AN OPEN HOLD ON THE SELECTED ITEM</desc>
    </event>

If I cause this event to be returned in the TPAC using the fr-CA locale, I see the following in the logs:

[{"__c":"osrfMessage","__p":{"threadTrace":"1","payload":{"__c":"osrfResult","__p":{"status":"OK","content":{"target":48,"result":[{"st
acktrace":"/usr/local/share/perl/5.10.1/OpenILS/Application/Circ/Holds.pm:290 /usr/local/share/perl/5.10.1/OpenSRF/Application.pm:594 /
usr/share/perl5/Error.pm:416","ilsevent":"1707","pid":"18797","desc":"User already has an open hold on the selected item","textcode":"H
OLD_EXISTS","servertime":"Thu Nov 14 12:13:01 2013"}]},"statusCode":200}},"type":"RESULT","locale":"fr-CA","ingress":"apache"}},{"__c":
"osrfMessage","__p":{"threadTrace":"1","payload":{"__c":"osrfConnectStatus","__p":{"status":"Request Complete","statusCode":205}},"type
":"STATUS","locale":"fr-CA","ingress":"apache"}}]

The desc is the English text, even though the fr-CA locale is mentioned in the message. Further down in the logs, we get:

[2013-11-14 12:13:01] /usr/sbin/apache2 [INFO:19047:Account.pm:1001:13844491551904722] batch hold placement result: {"target":48,"resul
t":[{"stacktrace":"/usr/local/share/perl/5.10.1/OpenILS/Application/Circ/Holds.pm:290 /usr/local/share/perl/5.10.1/OpenSRF/Application.
pm:594 /usr/share/perl5/Error.pm:416","ilsevent":"1707","pid":"18797","desc":"User already has an open hold on the selected item","text
code":"HOLD_EXISTS","servertime":"Thu Nov 14 12:13:01 2013"}]}

Still English, and no more mention of the locale. In the actual TPAC, we get the English description, even though everything around it is fr-CA.

Revision history for this message
Mike Rylander (mrylander) wrote :

Here's a branch that teaches OpenILS::Event how to get the current client-supplied locale when available. This will require OpenSRF version 2.2.1 or later.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/miker/event-locale

tags: added: pullrequest
Revision history for this message
Ben Shum (bshum) wrote :

Only pushing this to master for now. Not sure about backporting it.

Changed in evergreen:
milestone: none → 2.7.0
status: New → 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.