mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 11:03:58 +00:00
scons recipe: implemented update-po4a target; for now it updates only manual.
This commit is contained in:
parent
cdb4aba80c
commit
87d9b9aa59
23
SConstruct
23
SConstruct
@ -990,6 +990,29 @@ if "update-po" in COMMAND_LINE_TARGETS or "pot-update" in COMMAND_LINE_TARGETS:
|
||||
|
||||
env.Alias("update-po", [])
|
||||
|
||||
#
|
||||
# Manual and man pages translation
|
||||
#
|
||||
|
||||
def parse_po4a_cfg(cfg_file):
|
||||
cfg_file = cfg_file.replace("\\\n", "")
|
||||
po4a_cfg_re = re.compile(r"^\[(.*)\] (.*)$", re.MULTILINE)
|
||||
opts = dict(po4a_cfg_re.findall(cfg_file))
|
||||
return opts
|
||||
|
||||
if "update-po4a" in COMMAND_LINE_TARGETS:
|
||||
linguas = parse_po4a_cfg(File("po/wesnoth-manual/wesnoth-manual.cfg").get_contents())["po4a_langs"].split()
|
||||
po4a_targets = ["po/wesnoth-manual/wesnoth-manual.pot"]
|
||||
for lingua in linguas:
|
||||
po4a_targets.append(os.path.join("po/wesnoth-manual", lingua + ".po"))
|
||||
env.Precious(po4a_targets)
|
||||
for lingua in linguas:
|
||||
po4a_targets.append(os.path.join("doc/manual", "manual." + lingua + ".xml"))
|
||||
env.Command(po4a_targets, "doc/manual/manual.en.xml",
|
||||
"""po4a --no-backups --copyright-holder "Wesnoth Development Team" wesnoth-manual.cfg""", chdir = "po/wesnoth-manual")
|
||||
env.Alias("update-po4a", "po/wesnoth-manual/wesnoth-manual.pot")
|
||||
|
||||
|
||||
#
|
||||
# Dummy locales
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user