Bug 20085: Better translatability of smart-rules.tt
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 24 Jan 2018 13:23:30 +0000 (14:23 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 26 Mar 2018 20:01:10 +0000 (17:01 -0300)
commitf3dfd5226d0c077428df797fb8b829ed7f333748
tree2a2a4917be1e360f4e1e491742719a2a0d1f4ec3
parent952b2242cfccec7a5cedcc858942f940f80d757b
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 :

<select name="onshelfholds" id="onshelfholds">
    <option value="1">Yes</option>
    <option value="0">If any unavailable</option>
    <option value="2">If all unavailable</option>
</select>

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 <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt