[FIX] Load translation with invalid lang code

bzr revid: mra@tinyerp.com-20100204130643-wr7a9xnj7n3ixw3n
This commit is contained in:
mra (Open ERP) 2010-02-04 18:36:43 +05:30
parent 71e278598b
commit 42b2e2deef
1 changed files with 2 additions and 0 deletions

View File

@ -474,6 +474,8 @@ class module(osv.osv):
# unable to find the module. we skip
continue
for lang in filter_lang:
if len(lang) > 5:
raise osv.except_osv(_('Error'), _('You Can Not Load Translation For language Due To Invalid Language/Country Code'))
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: