X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2Fpostats.py;h=e4c38572facc936ef4199702337817144b6b2296;hb=fa9959fd41af1b9b11efd56c15e456d1194a6190;hp=64aa0ad318506c96430ba42c829ef7e1333444c9;hpb=d3752672b3f8fc05d6b1bffb7815c568a4a0c7c7;p=lyx.git diff --git a/po/postats.py b/po/postats.py index 64aa0ad318..e4c38572fa 100644 --- a/po/postats.py +++ b/po/postats.py @@ -24,13 +24,12 @@ to retrieve the number of translated/fuzzy/untranslated messages, 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="" import os @@ -38,7 +37,8 @@ import sys # Reset the locale import locale -locale.setlocale(locale.LC_ALL, '') +locale.setlocale(locale.LC_ALL, 'C') +os.environ['LC_ALL'] = 'C' def extract_number(line, issues, prop): """ @@ -105,6 +105,8 @@ def run_msgfmt(pofile): 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') @@ -137,4 +139,4 @@ $branch_tag = "%s"; // 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:]]))