From 62e0b88e4eeea587d3fed0f5cd6e5b91621c0f52 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. --- 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 fcf78bba98b..f5284698c13 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -226,7 +226,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 0068ae68690..77b11610ec7 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.34.1