From f3dfd5226d0c077428df797fb8b829ed7f333748 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 24 Jan 2018 14:23:30 +0100 Subject: [PATCH] Bug 20085: Better translatability of smart-rules.tt Template smart-rules.tt in administration contains some if/elsif/else with translatable strings. For example : [% IF rule.onshelfholds == 1 %] Yes [% ELSIF rule.onshelfholds == 2 %] If all unavailable [% ELSE %] If any unavailable [% END %] Adding span to translatable strings will allow to have the same translation than : This is important to allow editing an existing circulation and fine rule. Actually for example in french some strings are translated differently : msgid "%s Yes %s If all unavailable %s If any unavailable %s" msgstr "%s Oui %s Si tous indisponibles %s Si aucun indisponible %s" msgid "If any unavailable" msgstr "Si au moins un exemplaire est indisponible" Test plan : 1) Look at PO files, for example fr-FR and see there is : msgid "%s Yes %s If all unavailable %s If any unavailable %s" msgid "If any unavailable" 2) Apply patch 3) update PO files 4) Look at PO files, for example fr-FR and see there is now only : msgid "If any unavailable" 5) Install translation 6) Go to Administration > Circulation and fine rule 7) Check that when editing an existing rule, edition comboboxes are set on the correct value 8) Create a default holds policy by item type and check that correct values are displayed in table Signed-off-by: Mark Tompsett Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../prog/en/modules/admin/smart-rules.tt | 69 +++++++++++-------- 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index e1a5839f8a..ffa8776491 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -114,13 +114,13 @@ [% IF ( rule.unlimited_maxissueqty ) %] - Unlimited + Unlimited [% ELSE %] [% rule.maxissueqty %] [% END %] [% IF rule.unlimited_maxonsiteissueqty %] - Unlimited + Unlimited [% ELSE %] [% rule.maxonsiteissueqty %] [% END %] @@ -142,12 +142,18 @@ [% END %] [% ELSE %] - None defined + None defined [% END %] [% rule.fine %] [% rule.chargeperiod %] - [% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %] + + [% IF rule.chargeperiod_charge_at %] + Start of interval + [% ELSE %] + End of interval + [% END %] + [% rule.firstremind %] [% rule.overduefinescap FILTER format("%.2f") %] @@ -164,9 +170,9 @@ [% rule.norenewalbefore %] [% IF ( rule.auto_renew ) %] - Yes + Yes [% ELSE %] - No + No [% END %] [% rule.no_auto_renewal_after %] @@ -175,22 +181,31 @@ [% rule.holds_per_record %] [% IF rule.onshelfholds == 1 %] - Yes + Yes [% ELSIF rule.onshelfholds == 2 %] - If all unavailable + If all unavailable + [% ELSE %] + If any unavailable + [% END %] + + + [% IF rule.opacitemholds == 'F'%] + Force + [% ELSIF rule.opacitemholds == 'Y'%] + Allow [% ELSE %] - If any unavailable - [% END %] - [% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %] + Don't allow + [% END %] + [% IF rule.article_requests == 'no' %] - No + No [% ELSIF rule.article_requests == 'yes' %] - Yes + Yes [% ELSIF rule.article_requests == 'bib_only' %] - Record only + Record only [% ELSIF rule.article_requests == 'item_only' %] - Item only + Item only [% END %] [% rule.rentaldiscount %] @@ -479,13 +494,13 @@ [% END %] [% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %] - Unlimited + Unlimited [% ELSE %] [% branch_cat_rule_loo.maxissueqty %] [% END %] [% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %] - Unlimited + Unlimited [% ELSE %] [% branch_cat_rule_loo.maxonsiteissueqty %] [% END %] @@ -635,29 +650,29 @@ [% END %] [% IF ( branch_item_rule_loo.holdallowed_any ) %] - From any library + From any library [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %] - From home library + From home library [% ELSE %] - No holds allowed + No holds allowed [% END %] [% IF ( branch_item_rule_loo.hold_fulfillment_policy == 'any' ) %] - any library + any library [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'homebranch' ) %] - item's home library + item's home library [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'holdingbranch' ) %] - item's holding library + item's holding library [% END %] [% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %] - Item returns home + Item returns home [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %] - Item returns to issuing branch + Item returns to issuing branch [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %] - Item floats + Item floats [% ELSE %] - Error - unknown option + Error - unknown option [% END %] -- 2.39.5