- if ( $msgid ne "" && $msgstr ne "" ) {
-
- # Check colon at the end of a message
- if ( ( $msgid =~ m/: *(\|.*)?$/ ) != ( $msgstr =~ m/: *(\|.*)?$/ ) ) {
- print( "Missing or unexpected colon:\n" );
- print( " '$msgid' => '$msgstr'\n" );
- $warn++;
- }
-
- # Check period at the end of a message; uncomment code if you are paranoid
- #if ( ( $msgid =~ m/\. *(\|.*)?$/ ) != ( $msgstr =~ m/\. *(\|.*)?$/ ) ) {
- # print( "Missing or unexpected period:\n" );
- # print( " '$msgid' => '$msgstr'\n" );
- # $warn++;
- #}
-
- # Check space at the end of a message
- if ( ( $msgid =~ m/ *?(\|.*)?$/ ) != ( $msgstr =~ m/ *?(\|.*)?$/ ) ) {
- print( "Missing or unexpected space:\n" );
- print( " '$msgid' => '$msgstr'\n" );
- $warn++;
- }
-
- # Check for "&" shortcuts
- if ( ( $msgid =~ m/&[^ ]/ ) != ( $msgstr =~ m/&[^ ]/ ) ) {
- print( "Missing or unexpected Qt shortcut:\n" );
- print( " '$msgid' => '$msgstr'\n" );
- $warn++;
- }
-
- # Check for "|..." shortcuts
- if ( ( $msgid =~ m/\|[^ ]/ ) != ( $msgstr =~ m/\|[^ ]/ ) ) {
- print( "Missing or unexpected menu shortcut:\n" );
- print( " '$msgid' => '$msgstr'\n" );
- $warn++;
- }
-
- $msgid_clean = lc($msgid);
- $msgstr_clean = lc($msgstr);
-
- $msgid_clean =~ s/(.*)\|.*?$/$1/; # strip menu shortcuts
- $msgstr_clean =~ s/(.*)\|.*?$/$1/;
- $msgid_clean =~ s/&([^ ])/$1/; # strip Qt shortcuts
- $msgstr_clean =~ s/&([^ ])/$1/;
-
- $trans{$msgid_clean}{$msgstr_clean} = [ $msgid, $msgstr ];
- }
- } else {
- $i++;
+ # nothing to do if one of them is empty.
+ # (surely that is always $msgstr?)
+ next if ($msgid eq "" or $msgstr eq "");
+
+ # Check colon at the end of a message
+ if ( ( $msgid =~ m/: *(\|.*)?$/ ) != ( $msgstr =~ m/: *(\|.*)?$/ ) ) {
+ print( "Missing or unexpected colon:\n" );
+ print( " '$msgid' => '$msgstr'\n" );
+ $warn++;
+ }
+
+ # Check period at the end of a message; uncomment code if you are paranoid
+ #if ( ( $msgid =~ m/\. *(\|.*)?$/ ) != ( $msgstr =~ m/\. *(\|.*)?$/ ) ) {
+ # print( "Missing or unexpected period:\n" );
+ # print( " '$msgid' => '$msgstr'\n" );
+ # $warn++;
+ #}
+
+ # Check space at the end of a message
+ if ( ( $msgid =~ m/ *?(\|.*)?$/ ) != ( $msgstr =~ m/ *?(\|.*)?$/ ) ) {
+ print( "Missing or unexpected space:\n" );
+ print( " '$msgid' => '$msgstr'\n" );
+ $warn++;
+ }
+
+ # Check for "&" shortcuts
+ if ( ( $msgid =~ m/&[^ ]/ ) != ( $msgstr =~ m/&[^ ]/ ) ) {
+ print( "Missing or unexpected Qt shortcut:\n" );
+ print( " '$msgid' => '$msgstr'\n" );
+ $warn++;