aboutsummaryrefslogtreecommitdiffstats
path: root/english/po/wmlxgettext.pl
diff options
context:
space:
mode:
authorRhonda D'Vine <alfie>2002-11-14 18:23:15 +0000
committerRhonda D'Vine <alfie>2002-11-14 18:23:15 +0000
commit9390baedc5e0394d724ad03fdbec071d7d4e4765 (patch)
tree7435cf8eb144430400461874986ec3c8ee379220 /english/po/wmlxgettext.pl
parentd4abf811a0c4c7d37ebeab953ed105d6c3b15775 (diff)
Makefile & wmlxgettext.pl: Move only strings for the correct domain into the pot files, not all in the given files
others.pot & templates.pot: "More information" merged due to above fix ports.pot: Line numbers changed, no strings CVS version numbers english/po/Makefile: 1.31 -> 1.32 english/po/others.pot: 1.2 -> 1.3 english/po/ports.pot: 1.2 -> 1.3 english/po/templates.pot: 1.5 -> 1.6 english/po/wmlxgettext.pl: 1.3 -> 1.4
Diffstat (limited to 'english/po/wmlxgettext.pl')
-rwxr-xr-xenglish/po/wmlxgettext.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/english/po/wmlxgettext.pl b/english/po/wmlxgettext.pl
index 235659e0c1e..9b79450b106 100755
--- a/english/po/wmlxgettext.pl
+++ b/english/po/wmlxgettext.pl
@@ -8,6 +8,8 @@ use vars qw($opt_p);
my $messages = {};
my @msgids = ();
+my $domain = shift @ARGV;
+
sub escape {
my $text = shift;
$text =~ s/\\/\\\\/g;
@@ -42,10 +44,15 @@ sub processFile {
# Remove comments if they contain <gettext> or </gettext>
$text =~ s/^[ \t]*#.*<\/?gettext\b//mg;
$lineno = 1;
- while ($text =~ m{\G(.*?)(<gettext\b[^>]*>)(.*?)</gettext>}gs) {
- $msgid = escape($3);
+ while ($text =~ m{\G(.*?)(<gettext\b(?:\s+domain="([^"]+)")?[^>]*>)(.*?)</gettext>}gs) { # " -- to fix vim syntax hilighting :)
+ $msgid = escape($4);
$lineno += countNewline ($1.$2);
- $nextlineno = countNewline ($3);;
+ $nextlineno = countNewline ($4);;
+ my $dom = ($3) ? $3 : 'templates';
+ if ($domain ne $dom) {
+ $lineno += $nextlineno;
+ next; # wrong domain
+ }
$comment = '';
if ($1 =~ m/(((^|\n)[ \t]*#.*)+)\n?[^\n]*$/) {
$comment = $1;

© 2014-2024 Faster IT GmbH | imprint | privacy policy