From e6c2039ec40eaeb7b5a4fdd7982cd15179a74907 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Sun, 11 Jan 2009 19:01:06 +0100 Subject: [PATCH] [IMP] sort translations in the output translation file. Allow future patches to po files to be more realist bzr revid: christophe@taupe-20090111180106-uw6uvw44yggpfw2e --- bin/tools/translate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index b7a59538c9e..a25a8de0242 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -335,7 +335,7 @@ def trans_generate(lang, modules, dbname=None): _to_translate = [] def push_translation(module, type, name, id, source): - tuple = (module, type, name, id, source) + tuple = (module, source, name, id, type) if source and tuple not in _to_translate: _to_translate.append(tuple) @@ -486,8 +486,9 @@ def trans_generate(lang, modules, dbname=None): out = [["module","type","name","res_id","src","value"]] # header + _to_translate.sort() # translate strings marked as to be translated - for module, type, name, id, source in _to_translate: + for module, source, name, id, type in _to_translate: trans = trans_obj._get_source(cr, uid, name, type, lang, source) out.append([module, type, name, id, source, encode(trans) or ''])