Bug 20085 - Better translatability of smart-rules.tt
Summary: Better translatability of smart-rules.tt
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-24 13:23 UTC by Fridolin Somers
Modified: 2019-10-14 19:56 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20085: Better translatability of smart-rules.tt (10.79 KB, patch)
2018-01-24 13:35 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 20085: Better translatability of smart-rules.tt (10.64 KB, patch)
2018-03-06 05:42 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 20085: Better translatability of smart-rules.tt (10.69 KB, patch)
2018-03-19 02:47 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20085: Better translatability of smart-rules.tt (10.75 KB, patch)
2018-03-23 14:26 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2018-01-24 13:23:09 UTC
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"
Comment 1 Fridolin Somers 2018-01-24 13:35:55 UTC
Created attachment 70877 [details] [review]
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"

This patch adds span to translatable strings.
Also adds <em> on "Unlimited" and "None defined" so that there are more visible
and that there translation is more simple.

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
Comment 2 Jonathan Druart 2018-02-27 16:47:49 UTC
(In reply to Fridolin SOMERS from comment #1)
> Also adds <em> on "Unlimited" and "None defined" so that there are more
> visible
> and that there translation is more simple.

Why do you want to make them more visible? I do not think it should be done in this patch.
Comment 3 Fridolin Somers 2018-03-05 16:04:57 UTC
(In reply to Jonathan Druart from comment #2)
> (In reply to Fridolin SOMERS from comment #1)
> > Also adds <em> on "Unlimited" and "None defined" so that there are more
> > visible
> > and that there translation is more simple.
> 
> Why do you want to make them more visible? I do not think it should be done
> in this patch.

Its because there are a special case, like All for Patron category or Item type.

Otherwise we can use a simple span.
Comment 4 Fridolin Somers 2018-03-06 05:42:02 UTC
Created attachment 72455 [details] [review]
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
Comment 5 Fridolin Somers 2018-03-06 05:43:27 UTC
(In reply to Fridolin SOMERS from comment #3)
> (In reply to Jonathan Druart from comment #2)
> > (In reply to Fridolin SOMERS from comment #1)
> > > Also adds <em> on "Unlimited" and "None defined" so that there are more
> > > visible
> > > and that there translation is more simple.
> > 
> > Why do you want to make them more visible? I do not think it should be done
> > in this patch.
> 
> Its because there are a special case, like All for Patron category or Item
> type.
> 
> Otherwise we can use a simple span.

Ok corrected, one step at the time indeed ;)
Comment 6 Mark Tompsett 2018-03-19 02:47:37 UTC
Created attachment 73081 [details] [review]
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>
Comment 7 Nick Clemens 2018-03-23 14:26:17 UTC
Created attachment 73184 [details] [review]
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>
Comment 8 Jonathan Druart 2018-03-26 20:37:54 UTC
Pushed to master for 18.05, thanks to everybody involved!