X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=bin%2Fttxgettext;h=fddfbd0d458d393adf85920acdc0d64a616262df;hp=5e3aced61652e4bba97e67e18549c5012aa629fd;hb=c6fdd0f2653303fcc8a5307e106e77161f436b44;hpb=b8b780f25f2cb15def44c3579776c6df15cd6e90 diff --git a/bin/ttxgettext b/bin/ttxgettext index 5e3aced..fddfbd0 100755 --- a/bin/ttxgettext +++ b/bin/ttxgettext @@ -67,13 +67,15 @@ sub processFile { # $lineno += $nextlineno; # next; # wrong domain # } - $comment = ''; - if ($1 =~ m/(((^|\n)[ \t]*#.*)+)\n?[^\n]*$/) { - $comment = $1; - $comment =~ s/^\s+#\s*//; - $comment =~ s/\n[ \t]*#\s*/\n/g; - } - push (@msgids, $msgid); + $comment = ''; + if ($1 =~ m/(((^|\n)\s*(\[%)?\s*#.*)+)\n?[^\n]*$/) { + $comment = $1; + $comment =~ s/\[%//g; + $comment =~ s/%\]//g; + $comment =~ s/^\s+#\s*//; + $comment =~ s/\n[ \t]*#\s*/\n/g; + } + push (@msgids, $msgid); # if (defined ($messages->{$msgid})) { # print STDERR "ttxgettext: Warning: msgid multiple defined:\n\t". # $msgid."\n"; @@ -93,7 +95,7 @@ foreach (@ARGV) { } print "msgid \"\"\nmsgstr \"\"\n". - "\"Content-Type: text/plain; charset=ASCII\\n\"\n". + "\"Content-Type: text/plain; charset=UTF-8\\n\"\n". "\"Content-Transfer-Encoding: 8bit\\n\"\n\n"; foreach my $msgid (@msgids) {