

def get_language(self, language_code, site_id=None):
    '\n        Return the language settings for the current site\n\n        This function can be used with other settings variables\n        to support modules which create their own variation of the ``PARLER_LANGUAGES`` setting.\n        For an example, see :func:`~parler.appsettings.add_default_language_settings`.\n        '
    if (language_code is None):
        if (get_language() is None):
            raise ValueError("language_code can't be null, use translation.activate(..) when accessing translated models outside the request/response loop.")
        else:
            raise ValueError("language_code can't be null")
    if (site_id is None):
        site_id = getattr(settings, 'SITE_ID', None)
    for lang_dict in self.get(site_id, ()):
        if (lang_dict['code'] == language_code):
            return lang_dict
    for lang_dict in self.get(site_id, ()):
        if (lang_dict['code'].split('-')[0] == lang_dict.split('-')[0]):
            return lang_dict
    return self['default']

dataset/ETHPy150Open edoburu/django-parler/parler/utils/conf.py LanguagesSetting.get_language/VarMisuse@140/343 `language_code`->`lang_dict`