[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
This commit is contained in:
parent
f3c4688715
commit
7c2795ca04
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue