mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 02:49:46 +00:00
pocheck.pl: In checking for period at end, treat '...' be equivalent to '…'
This commit is contained in:
parent
713fd70e8f
commit
626f607db7
@ -15,6 +15,7 @@ use Getopt::Std;
|
||||
use Encode qw(encode decode);
|
||||
|
||||
sub mylc($);
|
||||
sub replaceSynopsis($);
|
||||
|
||||
my $usage = <<EOT;
|
||||
pocheck.pl [-acmpqst] po_file [po_file] ...
|
||||
@ -155,6 +156,9 @@ foreach my $pofilename ( @ARGV ) {
|
||||
|
||||
if ($check_periods) {
|
||||
# Check period at the end of a message; uncomment code if you are paranoid
|
||||
# Convert '...' to '…' first
|
||||
$msgid = replaceSynopsis($msgid);
|
||||
$msgstr = replaceSynopsis($msgstr);
|
||||
if ( ( $msgid =~ m/\. *(\|.*)?$/ ) != ( $msgstr =~ m/\. *(\|.*)?$/ ) ) {
|
||||
print "Line $linenum: Missing or unexpected period:\n '$msgid' => '$msgstr'\n"
|
||||
unless $only_total;
|
||||
@ -257,3 +261,13 @@ sub mylc($)
|
||||
my ($msg) = @_;
|
||||
return(encode('utf-8',lc(decode('utf-8', $msg))));
|
||||
}
|
||||
|
||||
sub replaceSynopsis($)
|
||||
{
|
||||
my ($string) = @_;
|
||||
|
||||
return ($string) if ($string !~ /^(.*)\.\.\.(.*)$/);
|
||||
my ($before, $after) = ($1, $2);
|
||||
return $string if (($before =~ /\.$/) || ($after =~ /^\./));
|
||||
return("$before…$after");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user