(env, lang_code=False)
return env['res.lang']._lang_get(lang)
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.
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.
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 .
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)
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 )