Bug 23452

Summary: Multiple select options in system preferences are not translatable
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: I18N/L10NAssignee: Bernardo Gonzalez Kriegel <bgkriegel>
Status: Pushed to master --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: bgkriegel, frederic, katrin.fischer
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
19.11.00
Attachments: Bug 23452: Multiple select options in system preferences are not translatable
Bug 23452: Multiple select options in system preferences are not translatable
Bug 23452: Multiple select options in system preferences are not translatable
Bug 23452: Multiple select options in system preferences are not translatable
Bug 23452: Multiple select options in system preferences are not translatable

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
Comment 5 Katrin Fischer 2019-11-24 13:42:23 UTC
Created attachment 95764 [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
Comment 6 Katrin Fischer 2019-11-24 13:42:52 UTC
Created attachment 95765 [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
Comment 7 Katrin Fischer 2019-11-24 13:43:47 UTC
Works like a charm, sorry I missed this before String freeze.
Comment 8 Jonathan Druart 2019-11-25 14:17:35 UTC
Created attachment 95789 [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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2019-11-25 14:18:23 UTC
Created attachment 95790 [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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Martin Renvoize 2019-11-26 11:46:21 UTC
Nice work!

Pushed to master for 19.11.00