X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=po%2Fpostats.py;h=29a243eccc5581d0f98f01f141542bd54326c78e;hb=292577ad69a4883c0f7081f35fc605c1b4a45a4d;hp=30bb958043c2375a12f1ac8c2bada0f32a4860e1;hpb=f99c05426a03c689a1919995abedaf67cf3197f8;p=lyx.git diff --git a/po/postats.py b/po/postats.py old mode 100644 new mode 100755 index 30bb958043..29a243eccc --- a/po/postats.py +++ b/po/postats.py @@ -24,18 +24,24 @@ 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="" +# 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 @@ -101,6 +107,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') @@ -119,18 +127,17 @@ array ( 'langcode' => '%(langcode)s', "date" => "%(date)s", if __name__ == "__main__": if lyx_branch: - branch_tag = "branches/%s" % lyx_branch + branch_tag = lyx_branch else: - branch_tag = "trunk" + branch_tag = "master" print """ -""" % (lyx_version, branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[1:]])) +$podata = array (%s +)?>""" % (sys.argv[1], branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[2:] if po not in ommitted]))