parameters: (env, lang_code=False)
return_statement: return env['res.lang']._lang_get(lang)
docstring: Retrieve the first lang object installed, by checking the parameter lang_code,
      the context and then the company. If no lang is installed from those variables,
      fallback on the first lang installed in the system.
      :param str lang_code: the locale (i.e. en_US)
      :return res.lang: the first lang found that is installed on the system.
docstring_summary: Retrieve the first lang object installed, by checking the parameter lang_code,
      the context and then the company. If no lang is installed from those variables,
      fallback on the first lang installed in the system.
      :param str lang_code: the locale (i.e. en_US)
      :return res.lang: the first lang found that is installed on the system.
docstring_tokens: Retrieve the first lang object installed by checking the parameter lang_code the context and then the company . If no lang is installed from those variables fallback on the first lang installed in the system . : param str lang_code : the locale ( i . e . en_US ) : return res . lang : the first lang found that is installed on the system .
function: def get_lang(env, lang_code=False):
      """
      Retrieve the first lang object installed, by checking the parameter lang_code,
      the context and then the company. If no lang is installed from those variables,
      fallback on the first lang installed in the system.
      :param str lang_code: the locale (i.e. en_US)
      :return res.lang: the first lang found that is installed on the system.
      """
      langs = [code for code, _ in env['res.lang'].get_installed()]
      lang = langs[0]
      if lang_code and lang_code in langs:
          lang = lang_code
      elif env.context.get('lang') in langs:
          lang = env.context.get('lang')
      elif env.user.company_id.partner_id.lang in langs:
          lang = env.user.company_id.partner_id.lang
      return env['res.lang']._lang_get(lang)
function_tokens: def get_lang ( env , lang_code = False ) : langs = [ code for code , _ in env [ 'res.lang' ] . get_installed ( ) ] lang = langs [ 0 ] if lang_code and lang_code in langs : lang = lang_code elif env . context . get ( 'lang' ) in langs : lang = env . context . get ( 'lang' ) elif env . user . company_id . partner_id . lang in langs : lang = env . user . company_id . partner_id . lang return env [ 'res.lang' ] . _lang_get ( lang )