$msgid = $msgid . $more;
$i++;
}
$msgid = $msgid . $more;
$i++;
}
# now look for the associated msgstr.
until ( ( $msgstr ) = ( $pofile[$i] =~ m/^msgstr "(.*)"/ ) ) { $i++; };
$i++;
# now look for the associated msgstr.
until ( ( $msgstr ) = ( $pofile[$i] =~ m/^msgstr "(.*)"/ ) ) { $i++; };
$i++;
# (surely that is always $msgstr?)
next if ($msgid eq "" or $msgstr eq "");
# (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" );
# Check colon at the end of a message
if ( ( $msgid =~ m/: *(\|.*)?$/ ) != ( $msgstr =~ m/: *(\|.*)?$/ ) ) {
print( "Missing or unexpected colon:\n" );
print( " '$msgid' => '$msgstr'\n" );
$warn++;
}
print( " '$msgid' => '$msgstr'\n" );
$warn++;
}
# we now collect these translations in a hash.
# this will allow us to check below if we have translated
# anything more than one way.
# we now collect these translations in a hash.
# this will allow us to check below if we have translated
# anything more than one way.