made wmlxgettext to restore the textdomain on #enddef,
...to match the new preprocessor behaviour
This commit is contained in:
parent
876d57c1d6
commit
dda5cb55ba
1 changed files with 12 additions and 1 deletions
|
@ -28,10 +28,21 @@ foreach my $file (@ARGV) {
|
|||
open (FILE, "<$file") or die "cannot read from $file";
|
||||
my $readingattack = 0;
|
||||
my @domainstack = ($initialdomain);
|
||||
my ($is_define, $macro_has_textdomain) = (0, 0);
|
||||
LINE: while (<FILE>) {
|
||||
# record a #define scope
|
||||
if (m/\#define\>/) {
|
||||
$is_define = 1; $macro_has_textdomain = 0;
|
||||
next LINE;
|
||||
} elsif (m/\#enddef\>/) {
|
||||
$is_define = 0;
|
||||
if ($macro_has_textdomain) { shift @domainstack; };
|
||||
}
|
||||
|
||||
# change the current textdomain when hitting the directive
|
||||
if (m/\s*\#textdomain\s+(\S+)/) {
|
||||
if (m/\#textdomain\s+(\S+)/) {
|
||||
unshift @domainstack, $1;
|
||||
if ($is_define) { $macro_has_textdomain = 1; };
|
||||
next LINE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue