and generates a PHP web page.
Invocation:
- postats.py po_files > "pathToWebPages"/i18n.inc
+ postats.py lyx_version po_files > "pathToWebPages"/i18n.inc
"""
-# modify this when you change version
+# modify this when you change branch
# Note that an empty lyx_branch variable (ie svn trunk)
# will "do the right thing".
-lyx_version="1.6.0svn"
lyx_branch=""
+# these po-files will be skipped:
+ommitted = ('en.po')
import os
import sys
+# Reset the locale
+import locale
+locale.setlocale(locale.LC_ALL, 'C')
+os.environ['LC_ALL'] = 'C'
+
def extract_number(line, issues, prop):
"""
line is a string like
prop["langcode"] = os.path.basename(pofile)[:-3]
prop["date"] = header['PO-Revision-Date'].split()[0]
prop["email"] = header['Last-Translator'].split('<')[1][:-1]
+ prop["email"] = prop["email"].replace("@", " () ")
+ prop["email"] = prop["email"].replace(".", " ! ")
translator = header['Last-Translator'].split('<')[0].strip()
try:
prop["translator"] = translator.decode(charset).encode('ascii','xmlcharrefreplace')
// The data itself
$podata = array (%s
-)?>
-""" % (lyx_version, branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[1:]]))
+)?>""" % (sys.argv[1], branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[2:] if po not in ommitted]))