From c2a14da3e2a6ebb2687dc44816382a5b2966aedf Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Fri, 5 Aug 2022 11:34:05 -0300 Subject: [PATCH] Bug 31292: Untranslatable string in sample_notices.yaml This patch removes a regex that discard lines in multiline YAML values On close inspection, there is no need for it. To test: 1) go to misc translator, update some language ./translate update fr-CA 2) check missing string egrep "You may pick up your article" po/fr-CA-installer.po from sample_notices.yaml 3) apply the patch, repeat 1) 4) repeat 2), verify the string is present in the translation file 5) translate the new string, install the language, verify string is present in the translated file ./translate install fr-CA check fr-CA/mandatory/sample_notices.yml There are three new strings msgid "%sDear %s %s,%s" msgid "%s%s%sTitle: %s" msgid "%sYou may pick up your article at %s.%sYou can download the scanned materials via the following url(s): %s.%s" Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 99790c6c38af93698069f5f493b299a715eabd68) Signed-off-by: Lucas Gass (cherry picked from commit 314595d9acd08af4c7f9672751555aa8f50b9a1f) Signed-off-by: Arthur Suzuki --- misc/translator/LangInstaller.pm | 1 - misc/translator/xgettext-installer | 3 --- 2 files changed, 4 deletions(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index ef6a5b154a..904f77cf87 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -317,7 +317,6 @@ sub translate_yaml { for my $field ( @translatable ) { # each translatable field if ( @multiline and grep { $_ eq $field } @multiline ) { # multiline fields, only notices ATM foreach my $line ( @{$row->{$field}} ) { - next if ( $line =~ /^(\s*<\/*\w+\s*>|\s*\[.*\]|\s*<.*\[.*\].*>|\s*)$/ ); # discard pure html, TT, empty my @ttvar; while ( $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/ ) { # put placeholders, save matches my $var = $1; diff --git a/misc/translator/xgettext-installer b/misc/translator/xgettext-installer index ecb134b14a..45d2a872e5 100755 --- a/misc/translator/xgettext-installer +++ b/misc/translator/xgettext-installer @@ -110,9 +110,6 @@ for my $file (@files) { foreach my $line ( @{ $row->{$field} } ) { $mulc++; - # discard pure html, TT, empty - next if ( $line =~ /^(\s*<\/*\w+\s*>|\s*\[.*\]|\s*<.*\[.*\].*>|\s*)$/ ); - # put placeholders $line =~ s/(<<.*?>>|\[\%.*?\%\]|<.*?>)/\%s/g; -- 2.39.5