From d17a24470d4bd09d19bc93d0b527d99dbe9fa542 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Mon, 4 Nov 2019 10:50:11 -0300 Subject: [PATCH] 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 --- misc/translator/LangInstaller.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index 55003af92e..47bddd6f36 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -185,7 +185,7 @@ sub add_prefs { for my $element ( @$pref ) { if ( ref( $element) eq 'HASH' ) { while ( my ($key, $value) = each(%$element) ) { - next unless $key eq 'choices'; + next unless $key eq 'choices' or $key eq 'multiple'; next unless ref($value) eq 'HASH'; for my $ckey ( keys %$value ) { my $id = $self->{file} . "#$pref_name# " . $value->{$ckey}; @@ -226,7 +226,7 @@ sub update_tab_prefs { my $element = $p->[$i]; if ( ref( $element) eq 'HASH' ) { while ( my ($key, $value) = each(%$element) ) { - next unless $key eq 'choices'; + next unless $key eq 'choices' or $key eq 'multiple'; next unless ref($value) eq 'HASH'; for my $ckey ( keys %$value ) { my $id = $self->{file} . "#$pref_name# " . $value->{$ckey}; -- 2.11.0