def scan_languages():
 csvpath = odoo.modules.module.get_resource_path('base', 'res', 'res.lang.csv')
 try:
  result = []
  with open(csvpath) as csvfile:
   reader = csv.reader(csvfile, delimiter=',', quotechar='"')
   fields = reader.next()
   code_index = fields.index('code')
   name_index = fields.index('name')
   for row in reader:
    result.append((ustr(row[code_index]), ustr(row[name_index])))
 except Exception:
  _logger.error('Could not read %s', csvpath)
  result = []
 return sorted((result or [('en_US', u'English')]), key=itemgetter(1))

def scan_languages ( ) : csvpath = odoo . modules . module . get_resource_path ( 'base' , 'res' , 'res.lang.csv' ) try : result = [ ] with open ( csvpath ) as csvfile : reader = csv . reader ( csvfile , delimiter = ',' , quotechar = '"' ) fields = reader . next ( ) code_index = fields . index ( 'code' ) name_index = fields . index ( 'name' ) for row in reader : result . append ( ( ustr ( row [ code_index ] ) , ustr ( row [ name_index ] ) ) ) except Exception : _logger . error ( 'Could not read %s' , csvpath ) result = [ ] return sorted ( ( result or [ ( 'en_US' , u'English' ) ] ) , key = itemgetter ( 1 ) )
returns all languages supported by openerp for translation :returns: a list of pairs :rtype: [] .