From 3f1bed6f14294c45feb2e18ecab271f8f3be5ea5 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 15 Oct 2020 11:38:52 +0200 Subject: [PATCH] Bug 26547: Fix msgctxt in pref PO file for blocks without a pref name Example in enhanced_content.pref: Enhanced content: Adlibris: - - NOTE: Using resources such as external images might leak sensitive data to third parties. --- misc/translator/xgettext-pref | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/translator/xgettext-pref b/misc/translator/xgettext-pref index 9b6190260f..97c986fb9e 100755 --- a/misc/translator/xgettext-pref +++ b/misc/translator/xgettext-pref @@ -118,17 +118,18 @@ sub add_prefs { } } for my $element (@$pref) { + my $new_context = $pref_name ? "$context > $pref_name" : $context; if ( ref($element) eq 'HASH' ) { while ( my ( $key, $value ) = each(%$element) ) { next unless $key eq 'choices' or $key eq 'multiple'; next unless ref($value) eq 'HASH'; for my $ckey ( keys %$value ) { - add_po( $file, "$context > $pref_name", $value->{$ckey} ); + add_po( $file, $new_context, $value->{$ckey} ); } } } elsif ($element) { - add_po( $file, "$context > $pref_name", $element ); + add_po( $file, $new_context, $element ); } } } -- 2.20.1