Added --domain (and --initialdomain) to wmlxgettext,

...to select the single textdomain to extract from the files.  It is
not really complete (not knowing about the WML scope of #textdomain,
and assuming textual scope), but sufficient for now.  Changed default
string-extraction rules to use --domain.  Added #textdomain in
"library" wml files from standard campaigns, in places where it would
be missing should those files be #included from different campaigns,
but mostly so their strings get extracted.
This commit is contained in:
Yann Dirson 2005-05-04 22:56:15 +00:00
parent 0d0542d26f
commit e0c6daf64c
17 changed files with 63 additions and 6 deletions

View file

@ -978,7 +978,7 @@ HIDE_UNDOC_RELATIONS = NO
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
HAVE_DOT = YES
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and

View file

@ -1,4 +1,5 @@
[event]
#textdomain wesnoth-ei
name=die
[filter]
description=Gweddry
@ -14,6 +15,7 @@
[/event]
[event]
#textdomain wesnoth-ei
name=die
[filter]
description=Dacyn
@ -29,6 +31,7 @@
[/event]
[event]
#textdomain wesnoth-ei
name=die
[filter]
description=Owaec
@ -43,6 +46,7 @@
[/event]
[event]
#textdomain wesnoth-ei
name=die
[filter]
description=Engineer

View file

@ -1,5 +1,6 @@
# XXX add all story graphics
[story]
#textdomain wesnoth-ei
[part]
music=wesnoth-1
story= _ "It was the thirtieth year of Konrad II's reign, and there were strange events happening on the eastern border of Wesnoth."

View file

@ -1,4 +1,5 @@
[event]
#textdomain wesnoth-httt
name=die
[filter]
description=Konrad
@ -13,6 +14,7 @@
[/event]
[event]
#textdomain wesnoth-httt
name=die
[filter]
description=Li'sar
@ -28,6 +30,7 @@
[/event]
[event]
#textdomain wesnoth-httt
name=die
[filter]
description=Kalenz
@ -41,6 +44,7 @@
[/endlevel]
[/event]
[event]
#textdomain wesnoth-httt
name=die
[filter]
description=Delfador

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-httt
[part]
music=wesnoth-1.ogg
story= _ "In the twenty-seventh year of the reign of Garard II, king of Wesnoth, the kingdom was plunged into a bitter war with the Peoples of the North."

View file

@ -5,6 +5,7 @@
#enddef
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
type=Orcish Shaman
@ -21,6 +22,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
type=Old Orcish Shaman
@ -37,6 +39,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
type=Novice Orcish Shaman
@ -53,6 +56,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
type=Orcish Priest Doctor
@ -69,6 +73,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
description=Kapou'e
@ -81,6 +86,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
description=Grüü
@ -93,6 +99,7 @@ name=die
[/event]
[event]
#textdomain wesnoth-sotbe
name=die
[filter]
description=Inarix

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-sotbe
[part]
story= _ "Rahul I, King of Wesnoth, concluded peace with orcs in the 4th year of his reign. He ended a 15 year war with Black Eye Karun, ruler of the orcs. A peace treaty defined which lands were devoted to orcs or humans. Years that followed the treaty were prosperous."

View file

@ -188,6 +188,7 @@ y={Y}
#define PIRATE_GALLEON X Y
[unit]
#textdomain wesnoth-sotbe
side=3
description=_ "Pirate Galleon"
type=Pirate Galleon

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-tdh
[part]
id=undead_intro_1

View file

@ -1,4 +1,5 @@
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Prince Haldric
@ -13,6 +14,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=King Eldaric IV
@ -27,6 +29,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Lady Jessica
@ -41,6 +44,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Lady Outlaw
@ -56,6 +60,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Burin the Lost
@ -67,6 +72,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Sir Ruddry
@ -79,6 +85,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Sir Ladoc
@ -91,6 +98,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=die
[filter]
description=Minister Edmond
@ -103,7 +111,8 @@
[/event]
[event]
name=die
#textdomain wesnoth-trow
name=die
[filter]
description=Lord Typhon
[/filter]

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-trow
[part]
music=underground.ogg
story= _ "In the days before Haldric the First saved our people, and founded the kingdom of Wesnoth, we came from an Isle far to the West..."

View file

@ -15,6 +15,7 @@
[/gold]
[message]
#textdomain wesnoth-trow
speaker=narrator
message= _ "You retrieve {AMOUNT} pieces of gold."
[/message]
@ -91,6 +92,7 @@
#ifdef EASY
[unit]
#textdomain wesnoth-trow
description=A Former Friend
user_description= _ "A Former Friend"
type=Walking Corpse
@ -106,6 +108,7 @@
#endif
#ifdef NORMAL
[unit]
#textdomain wesnoth-trow
description=A Former Friend
user_description= _ "A Former Friend"
type=Soulless
@ -121,6 +124,7 @@
#endif
#ifdef HARD
[unit]
#textdomain wesnoth-trow
description=A Former Friend
user_description= _ "A Former Friend"
type=Ghoul

View file

@ -1,4 +1,5 @@
[event]
#textdomain wesnoth-trow
name=turn 6
[if]
[variable]
@ -19,6 +20,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=turn 3
[if]
[variable]
@ -40,6 +42,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=turn 2
[if]
[variable]
@ -60,6 +63,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=turn 5
[if]
[variable]
@ -76,6 +80,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=turn 7
[if]
[variable]
@ -96,6 +101,7 @@
[/event]
[event]
#textdomain wesnoth-trow
name=turn 2
[if]
[variable]
@ -117,6 +123,7 @@
#Incorporate the return of the fleet in final scenarios
#[event]
# #textdomain wesnoth-trow
# name=turn 2
# [if]
# [variable]

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-trow
[part]
music=underground.ogg
story= _ "So it came to pass that Price Haldric was forced from his home, never to return. With the help of his father's noble sacrifice he has escaped the Southern pass. Haldric has left the lands of his home, and before him stretches the vast expanse of the southern kingdoms of his people."

View file

@ -1,4 +1,5 @@
[story]
#textdomain wesnoth-trow
[part]
music=underground.ogg
story= _ "Several days later Prince Haldric departs in his ship the Eldaric, his home and Isle lost to him forever. In his heart he knows he will never see his secluded valley again. Before him lay a vast expanse of stormy seas, and the mysterious island that Lady Jessica has mentioned, and even more exotic lands even further to the East."

View file

@ -117,7 +117,7 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
sed s/charset=CHARSET/charset=UTF-8/ $(DOMAIN).cpp.po > $(DOMAIN).cpp1.po ;\
fi
if test -r $(srcdir)/FINDCFG ;\
then ${WMLXGETTEXT} --directory=$(top_srcdir) \
then ${WMLXGETTEXT} --directory=$(top_srcdir) --domain=$(DOMAIN) \
`cd $(top_srcdir) && sh $(subdir)/FINDCFG` > $(DOMAIN).wml.po ;\
fi
if test -f $(DOMAIN).wml.po -a -f $(DOMAIN).cpp1.po ; then \

View file

@ -9,7 +9,13 @@ use POSIX qw(strftime);
use Getopt::Long;
our $toplevel = '.';
GetOptions ('directory=s' => \$toplevel);
our $initialdomain = 'wesnoth';
our $domain = undef;
GetOptions ('directory=s' => \$toplevel,
'initialdomain=s' => \$initialdomain,
'domain=s' => \$domain);
$domain = $initialdomain unless defined $domain;
our $module = dirname ($0) . "/wmltrans.pm";
eval "require \"$module\";";
@ -21,11 +27,19 @@ chdir $toplevel;
foreach my $file (@ARGV) {
open (FILE, "<$file") or die "cannot read from $file";
my $readingattack = 0;
my @domainstack = ($initialdomain);
LINE: while (<FILE>) {
# skip comments
# change the current textdomain when hitting the directive
if (m/\s*\#textdomain\s+(\S+)/) {
unshift @domainstack, $1;
next LINE;
}
# skip other # lines as comments
next LINE if m/^\s*\#/ and !defined $str;
next LINE unless $domainstack[0] eq $domain;
if (!defined $str and m/^(?:[^\"]*?)((?:_\s*)?)\"([^\"]*)\"(.*)/) {
# single-line quoted string