Bug 23452 - Multiple select options in system preferences are not translatable
Summary: Multiple select options in system preferences are not translatable
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 14:43 UTC by Caroline Cyr La Rose
Modified: 2019-11-04 14:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 23452: Multiple select options in system preferences are not translatable (2.24 KB, patch)
2019-11-04 14:07 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2019-08-12 14:43:51 UTC
The options in the pull-downs for system preferences that allow multiple choices are not translatable. 
See:
- ArticleRequestsMandatoryFields
- ArticleRequestsMandatoryFieldsItemOnly
- ArticleRequestMandatoryFieldsRecordOnly
- AutoShareWithMana
- CoceProviders
- decreaseLoanHighHoldsIgnoreStatuses
- MarkLostItemsAsReturned
- OpacAdvSearchMoreOptions
- OpacAdvSearchOptions
- OpacExportOptions
Comment 1 Owen Leonard 2019-08-12 17:31:38 UTC
The problem appears to only happen to system preferences with the key "multiple:" in the .pref file, so I wonder if the translation script is not parsing them at all.
Comment 2 Katrin Fischer 2019-11-02 21:24:26 UTC
(In reply to Owen Leonard from comment #1)
> The problem appears to only happen to system preferences with the key
> "multiple:" in the .pref file, so I wonder if the translation script is not
> parsing them at all

That makes sense. Adding Bernardo - maybe he has an idea.
Comment 3 Bernardo Gonzalez Kriegel 2019-11-04 13:42:38 UTC
Hi,
problem is that LangInstaller.pm ignores options other than 'choices',

egrep -n choices LangInstaller.pm 
189:                    next unless $key eq 'choices';
230:                    next unless $key eq 'choices';

Patch is comming.
Comment 4 Bernardo Gonzalez Kriegel 2019-11-04 14:07:27 UTC
Created attachment 95008 [details] [review]
Bug 23452: Multiple select options in system preferences are not translatable

Translate script ignores multiple options in system preferences,
this patch fix that.

To test:
1) Apply the patch
2) Go to misc/translator
cd misc/translator
3) Update your preferred language
perl translate update xx-YY
4) Updated pref file must contain new strings, eg.
egrep "when cataloguing an item" po/xx-YY-pref.po
5) Edit & translate that string
6) Install the updated translation
perl translate install xx-YY
7) Check that the translated pref file has
a) multiple options present
b) the message from 5) is translated
see for example circulation.pref
en: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
xx: koha-tmpl/intranet-tmpl/prog/xx-YY/modules/admin/preferences/circulation.pref