summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/module.py
diff options
context:
space:
mode:
authormra (Open ERP) <mra@tinyerp.com>2010-02-03 16:29:32 +0530
committermra (Open ERP) <mra@tinyerp.com>2010-02-03 16:29:32 +0530
commit710e784e382d1ea47c264de20e71da812ae274db (patch)
treed2e08683299f2425982af52fa6ed037252496bf8 /bin/addons/base/module/module.py
parent8321084bc1cebcf4c438d510d922536f2af96a0e (diff)
[IMP]: loading transaltion files with language name if it does not found with real name
bzr revid: mra@tinyerp.com-20100203105932-0hdesvu73lc2o4ay
Diffstat (limited to 'bin/addons/base/module/module.py')
-rw-r--r--bin/addons/base/module/module.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py
index a6967773ac2..f06f6fcc24e 100644
--- a/bin/addons/base/module/module.py
+++ b/bin/addons/base/module/module.py
@@ -196,7 +196,7 @@ class module(osv.osv):
return True
if isinstance(ids, (int, long)):
ids = [ids]
- mod_names = []
+ mod_names = []
for mod in self.read(cr, uid, ids, ['state','name'], context):
if mod['state'] in ('installed', 'to upgrade', 'to remove', 'to install'):
raise orm.except_orm(_('Error'),
@@ -204,7 +204,7 @@ class module(osv.osv):
mod_names.append(mod['name'])
#Removing the entry from ir_model_data
ids_meta = self.pool.get('ir.model.data').search(cr, uid, [('name', '=', 'module_meta_information'), ('module', 'in', mod_names)])
-
+
if ids_meta:
self.pool.get('ir.model.data').unlink(cr, uid, ids_meta, context)
@@ -476,6 +476,9 @@ class module(osv.osv):
for lang in filter_lang:
iso_lang = tools.get_iso_codes(lang)
f = os.path.join(modpath, 'i18n', iso_lang + '.po')
+ if not os.path.exists(f) and iso_lang.find('_') != -1:
+ f = os.path.join(modpath, 'i18n', iso_lang.split('_')[0] + '.po')
+ iso_lang = iso_lang.split('_')[0]
if os.path.exists(f):
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)