From 7c2795ca0423c6b0e01f79f30dc13b50e6860e80 Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Thu, 18 Dec 2014 11:42:04 +0100 Subject: [PATCH] [FIX] base: specify correct pot file linked to po In case of different directory for stroing po and pot files than 'i18n' (e.g. 'i18n_extra'), a po could be linked to a wrong pot file. Use the same folder as the po file to look for pot. Fixes #4326 --- openerp/tools/translate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 3c9a8a2642e..69837402535 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -953,10 +953,12 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True, # Normally the path looks like /path/to/xxx/i18n/lang.po # and we try to find the corresponding # /path/to/xxx/i18n/xxx.pot file. + # (Sometimes we have 'i18n_extra' instead of just 'i18n') addons_module_i18n, _ = os.path.split(fileobj.name) - addons_module, _ = os.path.split(addons_module_i18n) + addons_module, i18n_dir = os.path.split(addons_module_i18n) addons, module = os.path.split(addons_module) - pot_handle = misc.file_open(os.path.join(addons, module, 'i18n', module + '.pot')) + pot_handle = misc.file_open(os.path.join( + addons, module, i18n_dir, module + '.pot')) pot_reader = TinyPoFile(pot_handle) except: pass