From 738c641bccd7c65a7a3a22a5a898085a899b08cb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 7 Oct 2024 11:31:36 +0200 Subject: [PATCH] Bug 38085: Pick multiple_sortable options for translation Bug 29948 added a "multiple_sortable" type for sysprefs, to have the options sortable. But the options were not picked for translation. This patch fixes it. Test plan: Run `cd misc/translator && perl translate update LANG` before and after this patch. Notice that with this patch you see the different options of OPACAuthorIdentifiersAndInformation in the LANG-pref.po file (eg. "Associated group (373$a$s$t$u$v$0)") Translate the options Install the translated version of the templates and confirm that the strings appear translated on the interface. Signed-off-by: Caroline Cyr La Rose Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- misc/translator/LangInstaller.pm | 2 +- misc/translator/xgettext-pref | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index a0f323121e..15bee8355a 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -225,7 +225,7 @@ sub get_translated_pref { my $value = $syspref->{$key}; my $translated_value = $value; - if (($key eq 'choices' || $key eq 'multiple') && ref($value) eq 'HASH') { + if (($key eq 'choices' || $key eq 'multiple' || $key eq 'multiple_sortable') && ref($value) eq 'HASH') { $translated_value = { map { my $msgid = sprintf('%s#%s# %s', $file, $pref_name, $value->{$_}); diff --git a/misc/translator/xgettext-pref b/misc/translator/xgettext-pref index 0068ae6869..77b11610ec 100755 --- a/misc/translator/xgettext-pref +++ b/misc/translator/xgettext-pref @@ -120,7 +120,7 @@ sub add_prefs { for my $element (@$pref) { if ( ref($element) eq 'HASH' ) { while ( my ( $key, $value ) = each(%$element) ) { - next unless $key eq 'choices' or $key eq 'multiple'; + next unless $key eq 'choices' or $key eq 'multiple' or $key eq 'multiple_sortable'; next unless ref($value) eq 'HASH'; for my $ckey ( keys %$value ) { my $msgid = sprintf('%s#%s# %s', basename($file), $pref_name, $value->{$ckey}); -- 2.39.5