Implemented MsgMerge builder method.
This commit is contained in:
parent
64a616f58d
commit
1d83dc025a
2 changed files with 14 additions and 6 deletions
|
@ -9,7 +9,7 @@ Import("env")
|
|||
# Gettext message catalog generation
|
||||
#
|
||||
|
||||
textdomains = glob("*")
|
||||
textdomains = glob("wesnoth*")
|
||||
textdomains.remove("wesnoth-manpages")
|
||||
textdomains.remove("wesnoth-manual")
|
||||
textdomains = filter(os.path.isdir, textdomains)
|
||||
|
@ -71,10 +71,9 @@ if "update-po" in COMMAND_LINE_TARGETS or "pot-update" in COMMAND_LINE_TARGETS:
|
|||
linguas = open(os.path.join(domain, "LINGUAS")).read().split(" ")
|
||||
for lingua in linguas:
|
||||
lingua = lingua.rstrip("\n")
|
||||
update_po = env.Command(
|
||||
os.path.join(domain, lingua + ".po"),
|
||||
os.path.join(domain, domain + ".pot"),
|
||||
"msgmerge $TARGET $SOURCE -o $TARGET"
|
||||
update_po = env.MsgMerge(
|
||||
os.path.join(domain, lingua),
|
||||
os.path.join(domain, domain)
|
||||
)
|
||||
env.Precious(update_po)
|
||||
NoClean(update_po)
|
||||
|
|
|
@ -7,7 +7,7 @@ def exists():
|
|||
return True
|
||||
|
||||
def generate(env):
|
||||
env.AppendENVPath("PATH", os.path.join(env["gettextdir"], "bin"))
|
||||
env.AppendENVPath("PATH", join(env["gettextdir"], "bin"))
|
||||
env["MSGFMT"] = WhereIs("msgfmt")
|
||||
msgfmt = Builder(
|
||||
action = "$MSGFMT -c --statistics -o $TARGET $SOURCE",
|
||||
|
@ -16,3 +16,12 @@ def generate(env):
|
|||
single_source = True
|
||||
)
|
||||
env["BUILDERS"]["Msgfmt"] = msgfmt
|
||||
|
||||
env["MSGMERGE"] = WhereIs("msgmerge")
|
||||
msgmerge = Builder(
|
||||
action = "$MSGMERGE $TARGET $SOURCE -o $TARGET",
|
||||
src_suffix = ".pot",
|
||||
suffix = ".po",
|
||||
single_source = True
|
||||
)
|
||||
env["BUILDERS"]["MsgMerge"] = msgmerge
|
||||
|
|
Loading…
Add table
Reference in a new issue