Generate Wesnoth version into .po.

This commit is contained in:
Eric S. Raymond 2009-03-31 14:56:42 +00:00
parent aaeb68e7ae
commit 20b27ed164

View file

@ -68,10 +68,21 @@ Usage: wmlxgettext [options] dirpath
directories are given, all files under the current directory are checked.
""")
directory = os.getcwd()
# Deduce package and version
pop_to_top("wmlxgettext")
m = re.search(r"#define VERSION\s+(.*)", open("src/wesconfig.h").read())
if not m:
print >>sys.stderr, "wmlgettext: can't get Wesnoth version."
sys.exit(1)
else:
version = string_strip(m.group(1))
print '''\
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\\n"
"Project-Id-Version: wesnoth %s\\n"
"Report-Msgid-Bugs-To: http://bugs.wesnoth.org/\\n"
"POT-Creation-Date: %s\\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"
@ -80,10 +91,9 @@ msgstr ""
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
''' % time.strftime("%Y-%m-%d, %H:%M+0000", time.gmtime())
''' % (version, time.strftime("%Y-%m-%d, %H:%M+0000", time.gmtime()))
try:
directory = '.'
initialdomain = 'wesnoth'
domain = None
verbose = 0