[FIX]:loading translation of .zip module

lp bug: https://launchpad.net/bugs/885134 fixed

bzr revid: nch@tinyerp.com-20111130085452-vcrxnv86avhfihom
This commit is contained in:
Naresh (OpenERP)
2011-11-30 14:24:52 +05:30
parent 20b398613c
commit f211942d6a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -542,13 +542,13 @@ class module(osv.osv):
if f2:
logger.info('module %s: loading base translation file %s for language %s', mod.name, iso_lang2, lang)
tools.trans_load(cr, f2, lang, verbose=False, context=context)
context2['overwrite'] = True
# Implementation notice: we must first search for the full name of
# the language derivative, like "en_UK", and then the generic,
# like "en".
if (not f) and '_' in iso_lang:
iso_lang = iso_lang.split('_')[0]
f = addons.get_module_resource(mod.name, 'i18n', iso_lang + '.po')
context2['overwrite'] = True
if f:
logger.info('module %s: loading translation file (%s) for language %s', mod.name, iso_lang, lang)
tools.trans_load(cr, f, lang, verbose=False, context=context2)
+1 -1
View File
@@ -840,7 +840,7 @@ def trans_generate(lang, modules, cr):
def trans_load(cr, filename, lang, verbose=True, context=None):
logger = logging.getLogger('i18n')
try:
fileobj = open(filename,'r')
fileobj = misc.file_open(filename)
logger.info("loading %s", filename)
fileformat = os.path.splitext(filename)[-1][1:].lower()
r = trans_load_data(cr, fileobj, fileformat, lang, verbose=verbose, context=context)