Fixed wmlxgettext so that it understands escaped quotes.
This commit is contained in:
parent
c100cd0525
commit
0c85a3a440
2 changed files with 4 additions and 3 deletions
|
@ -77,6 +77,7 @@ sub stripfromwml {
|
|||
sub raw2postring {
|
||||
my $str = shift;
|
||||
|
||||
$str =~ s/\"\"/\\\"/mg;
|
||||
$str =~ s/^(.*)$/"$1\\n"/mg;
|
||||
$str =~ s/\n$/\n"\\n"/mg;
|
||||
$str =~ s/\\n\"$/\"\n/g;
|
||||
|
|
|
@ -58,7 +58,7 @@ foreach my $file (@ARGV) {
|
|||
# skip other # lines as comments
|
||||
next LINE if m/^\s*\#/ and !defined $str;
|
||||
|
||||
if (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*)\"(.*)/) {
|
||||
if (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*(?:\"\"[^\"]*)*)\"(.*)/) {
|
||||
# single-line quoted string
|
||||
|
||||
$translatable = ($1 ne '');
|
||||
|
@ -79,7 +79,7 @@ foreach my $file (@ARGV) {
|
|||
$_ = $rest . "\n";
|
||||
redo LINE;
|
||||
|
||||
} elsif (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\s*\"([^\"]*)/) {
|
||||
} elsif (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\s*\"([^\"]*(?:\"\"[^\"]*)*)/) {
|
||||
# start of multi-line
|
||||
|
||||
$translatable = ($1 ne '');
|
||||
|
@ -88,7 +88,7 @@ foreach my $file (@ARGV) {
|
|||
$str = $_;
|
||||
$line = $.;
|
||||
|
||||
} elsif (m/(.*?)\"(.*)/) {
|
||||
} elsif (m/([^\"]*(?:\"\"[^\"]*)*)\"(.*)/) {
|
||||
# end of multi-line
|
||||
die "end of string without a start in $file" if !defined $str;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue