mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Have pocheck.pl check for missing arguments, like %1$s, etc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38263 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
772262ca3d
commit
1856b0a6df
@ -60,6 +60,25 @@ foreach $pofilename ( @ARGV )
|
||||
# (surely that is always $msgstr?)
|
||||
next if ($msgid eq "" or $msgstr eq "");
|
||||
|
||||
# Check for matching %1$s, etc.
|
||||
@argstrs = ( $msgid =~ m/%(\d)\$s/g );
|
||||
if (@argstrs) {
|
||||
$num = 0;
|
||||
foreach $arg (@argstrs) { $num = $arg if $arg > $num; }
|
||||
if ($num <= 0) {
|
||||
print "Problem finding arguments in:\n $msgid!\n";
|
||||
$warn++;
|
||||
} else {
|
||||
foreach $i (1..$num) {
|
||||
$arg = "%$i\\\$s";
|
||||
if ( $msgstr !~ m/$arg/ ) {
|
||||
print "Missing argument `$arg'\n '$msgid' ==> '$msgstr'\n";
|
||||
$warn++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Check colon at the end of a message
|
||||
if ( ( $msgid =~ m/: *(\|.*)?$/ ) != ( $msgstr =~ m/: *(\|.*)?$/ ) ) {
|
||||
print( "Missing or unexpected colon:\n" );
|
||||
|
Loading…
Reference in New Issue
Block a user