X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2Fpocheck.pl;h=391245a11ebc2ef672c2ff7f0943a38b001bcd19;hb=0d84f0b9fdfce831e39676307bc954f7389198d1;hp=44d077d6ca50f6cb5711f4523ec0f2c265d643dc;hpb=f8e62a94d9bca370120d0a26e5de61622b85d081;p=lyx.git diff --git a/po/pocheck.pl b/po/pocheck.pl index 44d077d6ca..391245a11e 100755 --- a/po/pocheck.pl +++ b/po/pocheck.pl @@ -15,13 +15,14 @@ use Getopt::Std; use Encode qw(encode decode); sub mylc($); +sub replaceSynopsis($); my $usage = < '$msgstr'\n" unless $only_total; @@ -175,7 +179,7 @@ foreach my $pofilename ( @ARGV ) { if ($check_qt) { # Check for "&" shortcuts - if ( ( $msgid =~ m/&[^ ]/ ) != ( $msgstr =~ m/&[^ ]/ ) ) { + if ( ( $msgid =~ m/&[^ &]/ ) != ( $msgstr =~ m/&[^ &]/ ) ) { print "Line $linenum: Missing or unexpected Qt shortcut:\n '$msgid' => '$msgstr'\n" unless $only_total; ++$bad{"Bad Qt shortcuts"}; @@ -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"); +}