Generate Wesnoth version into .po.
This commit is contained in:
parent
aaeb68e7ae
commit
20b27ed164
1 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue