From ab171f8f303306f5b45e2ccaa4c47404b11b0256 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Mon, 15 Jun 2009 07:34:25 +0000 Subject: updated localization --- scripts/update_localization.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/update_localization.py') diff --git a/scripts/update_localization.py b/scripts/update_localization.py index 087f55a4..d3c948aa 100644 --- a/scripts/update_localization.py +++ b/scripts/update_localization.py @@ -38,16 +38,20 @@ def load_languagefile(filename): def generate_languagefile(outputfilename, srctable, loctable): - f = file(outputfilename, "w") + tmpfilename = outputfilename[:-1]+"_" + f = file(tmpfilename, "w") num_items = 0 new_items = 0 old_items = 0 + srctable_keys = srctable.keys() + srctable_keys.sort() + print >>f, "" print >>f, "##### translated strings #####" print >>f, "" - for k in srctable: + for k in srctable_keys: if k in loctable and len(loctable[k]): print >>f, k print >>f, "==", loctable[k] @@ -57,7 +61,7 @@ def generate_languagefile(outputfilename, srctable, loctable): print >>f, "##### needs translation ####" print >>f, "" - for k in srctable: + for k in srctable_keys: if not k in loctable or len(loctable[k]) == 0: print >>f, k print >>f, "==", srctable[k] @@ -78,6 +82,8 @@ def generate_languagefile(outputfilename, srctable, loctable): print "%-40s %8s %8s %8s" % ("filename", "total", "new", "old") print "%-40s %8d %8d %8d" % (outputfilename, num_items, new_items, old_items) f.close() + + os.rename(tmpfilename, outputfilename) srctable = parse_source() -- cgit 1.4.1