[IMP] modify update translation defination now it will check iso code for file name (Translation)

bzr revid: mra@tinyerp.com-20091120113928-s9tbbmwjnct11t38
This commit is contained in:
mra (Open ERP) 2009-11-20 17:09:28 +05:30
parent afb45ede6d
commit 514188aa52
1 changed files with 11 additions and 12 deletions

View File

@ -450,7 +450,6 @@ class module(osv.osv):
def update_translations(self, cr, uid, ids, filter_lang=None):
logger = netsvc.Logger()
if not filter_lang:
pool = pooler.get_pool(cr.dbname)
lang_obj = pool.get('res.lang')
@ -467,12 +466,12 @@ class module(osv.osv):
# unable to find the module. we skip
continue
for lang in filter_lang:
f = os.path.join(modpath, 'i18n', lang + '.po')
iso_lang = tools.get_iso_codes(lang)
f = os.path.join(modpath, 'i18n', iso_lang + '.po')
if os.path.exists(f):
logger.notifyChannel("i18n", netsvc.LOG_INFO, 'module %s: loading translation file for language %s' % (mod.name, lang))
logger.notifyChannel("i18n", netsvc.LOG_INFO, 'module %s: loading translation file for language %s' % (mod.name, iso_lang))
tools.trans_load(cr.dbname, f, lang, verbose=False)
def check(self, cr, uid, ids, context=None):
logger = netsvc.Logger()
for mod in self.browse(cr, uid, ids, context=context):