[IMP] replaces tools.misc.get_languages by the static dictionary it returns, rename that dict to ALL_LANGUAGES for clarity

bzr revid: xmo@openerp.com-20120223103045-a44cl5kdkrnehc66
This commit is contained in:
Xavier Morel 2012-02-23 11:30:45 +01:00
parent e3cc141be5
commit 2332c23c30
2 changed files with 83 additions and 87 deletions

View File

@ -80,7 +80,7 @@ class lang(osv.osv):
_logger.warning(msg, lang, lc)
if not lang_name:
lang_name = tools.get_languages().get(lang, lang)
lang_name = tools.ALL_LANGUAGES.get(lang, lang)
def fix_xa0(s):

View File

@ -550,10 +550,7 @@ def get_iso_codes(lang):
lang = lang.split('_')[0]
return lang
def get_languages():
# The codes below are those from Launchpad's Rosetta, with the exception
# of some trivial codes where the Launchpad code is xx and we have xx_XX.
languages={
ALL_LANGUAGES = {
'ab_RU': u'Abkhazian / аҧсуа',
'ar_AR': u'Arabic / الْعَرَبيّة',
'bg_BG': u'Bulgarian / български език',
@ -634,11 +631,10 @@ def get_languages():
'th_TH': u'Thai / ภาษาไทย',
'tlh_TLH': u'Klingon',
}
return languages
def scan_languages():
# Now it will take all languages from get languages function without filter it with base module languages
lang_dict = get_languages()
lang_dict = ALL_LANGUAGES
ret = [(lang, lang_dict.get(lang, lang)) for lang in list(lang_dict)]
ret.sort(key=lambda k:k[1])
return ret