* src/po/check_po: Support for multiple files as command line arguments; untranslated strings dont need mismatch tests
svn: r5162
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2005-09-01 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||
* src/po/check_po: Support for multiple files as command line
|
||||
arguments; untranslated strings dont need mismatch tests
|
||||
|
||||
2005-08-31 Don Allingham <don@gramps-project.org>
|
||||
* src/plugins/RelCalc.py: use PeopleModel instead of ListModel,
|
||||
check to the person being compared to him/herself
|
||||
|
||||
@@ -6,8 +6,19 @@ MSGSTR = 2
|
||||
|
||||
import sys
|
||||
import re
|
||||
f = open(sys.argv[1],"r")
|
||||
|
||||
all_total = {}
|
||||
all_untranslated = {}
|
||||
all_percent_s = {}
|
||||
all_named_s = {}
|
||||
all_bnamed_s = {}
|
||||
all_coverage = {}
|
||||
|
||||
args = sys.argv
|
||||
while len(args) > 1:
|
||||
args = args[1:]
|
||||
|
||||
f = open(args[0],"r")
|
||||
|
||||
mode = NONE
|
||||
|
||||
@@ -53,6 +64,7 @@ bnamed_s_list = []
|
||||
for i in string_map.keys():
|
||||
if string_map[i] == "":
|
||||
untranslated += 1
|
||||
continue
|
||||
|
||||
cnt1 = i.count('%s')
|
||||
cnt2 = string_map[i].count('%s')
|
||||
@@ -79,12 +91,19 @@ for i in string_map.keys():
|
||||
|
||||
coverage = (1.0 - (float(untranslated)/float(total))) * 100
|
||||
|
||||
print "File: %s" % args[0]
|
||||
print "Total: %d" % total
|
||||
all_total[args[0]] = total
|
||||
print "Untranslated: %d" % untranslated
|
||||
all_untranslated[args[0]] = untranslated
|
||||
print "%%s mismatches: %d" % percent_s
|
||||
all_percent_s[args[0]] = percent_s
|
||||
print "%%()s mismatches: %d" % named_s
|
||||
all_named_s[args[0]] = named_s
|
||||
print "%%() missing s/d: %d" % bnamed_s
|
||||
all_bnamed_s[args[0]] = bnamed_s
|
||||
print "Coverage: %5.2f%%" % coverage
|
||||
all_coverage[args[0]] = coverage
|
||||
|
||||
if percent_s:
|
||||
print "\n-------- %s mismatches --------------"
|
||||
@@ -100,4 +119,17 @@ if bnamed_s:
|
||||
print "\n-------- %() missing s or d ---------"
|
||||
for i in bnamed_s_list:
|
||||
print "'%s' : '%s'" % (i, string_map[i])
|
||||
print ""
|
||||
|
||||
|
||||
if len(sys.argv) > 2:
|
||||
print "\n\nFile \tTotal \tUntranslated. \t%s mismatch \t%()s mismatch \tmissing s/d \tCoverage"
|
||||
for pofile in sys.argv[1:]:
|
||||
print "%s \t%5d \t%7d \t%7d \t%7d \t%7d \t%3.2f%%" %\
|
||||
(pofile,
|
||||
all_total[pofile],
|
||||
all_untranslated[pofile],
|
||||
all_percent_s[pofile],
|
||||
all_named_s[pofile],
|
||||
all_bnamed_s[pofile],
|
||||
all_coverage[pofile])
|
||||
|
||||
Reference in New Issue
Block a user