Bug 41105: (QA follow-up) Fix gender label translation
The batch patron modification "Gender" column and edit dropdown
hardcoded "Female"/"Male"/"Other" as data passed from
tools/modborrowers.pl, and the "Other" gender label was displayed as
plain text.
Values coming from Perl as template data are never picked up by the
PO extractor, so the gender select options in the edit form could
never be translated. Elsewhere in Koha (moremember.tt,
moremember-brief.tt, memberentrygen.tt, opac-memberentry.tt) the
"Other" gender label is wrapped with tp('gender', 'Other') to give
translators context, since "Other" is ambiguous out of context.
This makes the "Gender" dropdown options translatable directly from
the template, and aligns "Other" with the existing tp('gender', ...)
convention used everywhere else gender is displayed.
Test plan:
1. Navigate to Patrons and click Search, to display a list of patrons.
2. Select all results and click "Batch patron modification".
3. Verify the "Gender" column and "Gender" edit dropdown still work as
expected.
4. Confirm (e.g. via the .pot file or misc/translator/translate) that
"Female", "Male" and the "Other" (gender) msgctxt string are now
extracted for translation from this template.
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
0bb26abd5a
commit
b51a3f111a
|
|
@ -264,7 +264,7 @@
|
|||
[% ELSIF borrower.sex == 'M' %]
|
||||
Male
|
||||
[% ELSIF borrower.sex == 'O' %]
|
||||
Other
|
||||
[% tp('gender', 'Other') | html %]
|
||||
[% END %]
|
||||
</td>
|
||||
<td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
|
||||
|
|
@ -421,7 +421,17 @@
|
|||
[% IF field.option.size %]
|
||||
<select id="[% field.name | html %]" name="[% field.name | html %]">
|
||||
[% FOREACH opt IN field.option %]
|
||||
<option value="[% opt.value | html %]">[% opt.lib | html %]</option>
|
||||
<option value="[% opt.value | html %]">
|
||||
[% IF field.name == 'sex' && opt.value == 'F' %]
|
||||
Female
|
||||
[% ELSIF field.name == 'sex' && opt.value == 'M' %]
|
||||
Male
|
||||
[% ELSIF field.name == 'sex' && opt.value == 'O' %]
|
||||
[% tp('gender', 'Other') | html %]
|
||||
[% ELSE %]
|
||||
[% opt.lib | html %]
|
||||
[% END %]
|
||||
</option>
|
||||
[% END %]
|
||||
</select>
|
||||
[% ELSE %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue