Enhance the scripts/update_localization.py a bit

Fix a bug with mixing up new and old translations.
This commit is contained in:
heinrich5991 2014-02-06 17:51:22 +01:00 committed by oy
parent d73165f563
commit 7e2224b392

View file

@ -72,14 +72,21 @@ def write_languagefile(outputfilename, l10n_src, old_l10n_data):
JSON_KEY_OR: x,
JSON_KEY_TR: translations.get(x, ""),
}
for x in set_
for x in sorted(set_)
]
result[JSON_KEY_TRANSL] = to_transl(tsl_items)
result[JSON_KEY_UNTRANSL] = to_transl(new_items)
result[JSON_KEY_OLDTRANSL] = to_transl(old_items)
json.dump(result, open(outputfilename, 'w'), sort_keys=True, indent=2)
json.dump(
result,
open(outputfilename, 'w'),
ensure_ascii=False,
indent="\t",
separators=(',', ': '),
sort_keys=True,
)
print(format(outputfilename, len(num_items), len(new_items), len(old_items)))
@ -96,4 +103,3 @@ if __name__ == '__main__':
except Exception as e:
print("Failed on {0}, re-raising for traceback".format(filename))
raise