[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:
parent
afb45ede6d
commit
514188aa52
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue