From 7657163d8f9fb0f2932dc663fdec1ce8e2c8e3c4 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 Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- 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.39.5