commit e703ff6a94453fdf40c8897bded31ba21e38271c Author: Kornel Benko <kor...@lyx.org> Date: Thu Apr 3 20:39:56 2025 +0200
Handle multiple use of [[something]] in po-file We have strings like '[[reference 1]], [[reference2, ...]]' which otherwise would be stripped to '', therefore the test for trailing space would fail. --- po/pocheck.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/po/pocheck.pl b/po/pocheck.pl index fcc5dc11dd..16fc0c7fac 100755 --- a/po/pocheck.pl +++ b/po/pocheck.pl @@ -117,7 +117,9 @@ foreach my $pofilename ( @ARGV ) { # discard [[...]] from the end of msgid, this is used only as hint to translation $msgid_trans = $msgid; # used for uniform translation - $msgid =~ s/\[\[.*\]\]$//; + while ($msgid =~ s/\[\[[^\]]*\]\]//) { + ; + } # Check for matching %1$s, etc. if ($check_args) { @@ -180,10 +182,12 @@ foreach my $pofilename ( @ARGV ) { } } if (($msgid1 =~ / $/) != ($msgstr1 =~ / $/)) { - print "Line $linenum: Missing or unexpected space:\n '$msgid' => '$msgstr'\n" - unless $only_total; - ++$bad{"Bad spaces"}; - $warn++; + { + print "Line $linenum: Missing or unexpected space:\n '$msgid' => '$msgstr'\n" + unless $only_total; + ++$bad{"Bad spaces"}; + $warn++; + } } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-cvs