From 4a13d896946250245e6866357c1b2ce134c01417 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 2 Nov 2011 09:47:04 -0400 Subject: [PATCH] Tpac; hold error message 18n string extraction repairs Make it possible for xgettext.pl (using Locale::Maketext::Extract::Plugin::TT2) to extract hold error message strings for translation. The plugin is not quite smart enough to extract wholly dynamic values from the templates, since it (presumably) only parses the templates and does not execute them. The solution is to wrap the strings in l() where they are defined. Add an example for the EVENT_MSG_MAP for the event PATRON_EXCEEDS_FINES. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- .../templates/opac/parts/hold_error_messages.tt2 | 35 +++++++++++----------- .../src/templates/opac/parts/place_hold_result.tt2 | 4 +-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/hold_error_messages.tt2 b/Open-ILS/src/templates/opac/parts/hold_error_messages.tt2 index 9ba6f0e548..e79e81df1b 100644 --- a/Open-ILS/src/templates/opac/parts/hold_error_messages.tt2 +++ b/Open-ILS/src/templates/opac/parts/hold_error_messages.tt2 @@ -8,23 +8,23 @@ # these are used to pass them through l() for i18n. FAIL_PART_MSG_MAP = { - "actor.usr.barred" => "The patron is barred", - "asset.copy.circulate" => "The item does not circulate", - "asset.copy_location.circulate" => "Items from this shelving location do not circulate", - "asset.copy.status" => "The item cannot circulate at this time", - "circ.holds.target_skip_me" => "The item's circulation library does not fulfill holds", - "config.circ_matrix_circ_mod_test" => "The patron has too many items of this type checked out", - "config.circ_matrix_test.available_copy_hold_ratio" => "The available item-to-hold ratio is too low", - "config.circ_matrix_test.circulate" => "Circulation rules reject this item as non-circulatable", - "config.circ_matrix_test.total_copy_hold_ratio" => "The total item-to-hold ratio is too low", - "config.hold_matrix_test.holdable" => "Hold rules reject this item as unholdable", - "config.hold_matrix_test.max_holds" => "The patron has reached the maximum number of holds", - "config.rule_age_hold_protect.prox" => "The item is too new to transit this far", - "no_item" => "The system could not find this item", - "no_ultimate_items" => "The system could not find any items to match this hold request", - "no_matchpoint" => "System rules do not define how to handle this item", - "no_user" => "The system could not find this patron", - "transit_range" => "The item cannot transit this far" + "actor.usr.barred" => l("The patron is barred"), + "asset.copy.circulate" => l("The item does not circulate"), + "asset.copy_location.circulate" => l("Items from this shelving location do not circulate"), + "asset.copy.status" => l("The item cannot circulate at this time"), + "circ.holds.target_skip_me" => l("The item's circulation library does not fulfill holds"), + "config.circ_matrix_circ_mod_test" => l("The patron has too many items of this type checked out"), + "config.circ_matrix_test.available_copy_hold_ratio" => l("The available item-to-hold ratio is too low"), + "config.circ_matrix_test.circulate" => l("Circulation rules reject this item as non-circulatable"), + "config.circ_matrix_test.total_copy_hold_ratio" => l("The total item-to-hold ratio is too low"), + "config.hold_matrix_test.holdable" => l("Hold rules reject this item as unholdable"), + "config.hold_matrix_test.max_holds" => l("The patron has reached the maximum number of holds"), + "config.rule_age_hold_protect.prox" => l("The item is too new to transit this far"), + "no_item" => l("The system could not find this item"), + "no_ultimate_items" => l("The system could not find any items to match this hold request"), + "no_matchpoint" => l("System rules do not define how to handle this item"), + "no_user" => l("The system could not find this patron"), + "transit_range" => l("The item cannot transit this far") }; @@ -34,5 +34,6 @@ # Wait until these are used to pass them through l() for i18n. EVENT_MSG_MAP = { + "PATRON_EXCEEDS_FINES" => l("Patron has reached the maximum fine amount") }; %] diff --git a/Open-ILS/src/templates/opac/parts/place_hold_result.tt2 b/Open-ILS/src/templates/opac/parts/place_hold_result.tt2 index b83a81129c..7ff5541d78 100644 --- a/Open-ILS/src/templates/opac/parts/place_hold_result.tt2 +++ b/Open-ILS/src/templates/opac/parts/place_hold_result.tt2 @@ -53,8 +53,8 @@ event_key = hdata.hold_failed_event.textcode; # display: - l(FAIL_PART_MSG_MAP.$fail_part_key) || - l(EVENT_MSG_MAP.$event_key) || + FAIL_PART_MSG_MAP.$fail_part_key || + EVENT_MSG_MAP.$event_key || l(hdata.hold_failed_event.desc) || hdata.hold_failed_event.payload.fail_part || hdata.hold_failed_event.textcode || -- 2.11.0