Author: esr
Date: Tue Mar 31 16:56:42 2009
New Revision: 34334
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34334&view=rev
Log:
Generate Wesnoth version into .po.
Modified:
trunk/data/tools/wmlxgettext
Modified: trunk/data/tools/wmlxgettext
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlxgettext?rev=34334&r1=34333&r2=34334&view=diff
==============================================================================
--- trunk/data/tools/wmlxgettext (original)
+++ trunk/data/tools/wmlxgettext Tue Mar 31 16:56:42 2009
@@ -68,10 +68,21 @@
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 @@
"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
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits