# Path: modeltranslation/settings.py
# TRANSLATION_FILES = tuple(getattr(settings, "MODELTRANSLATION_TRANSLATION_FILES", ()))
# AVAILABLE_LANGUAGES = list(
#     getattr(
#         settings,
#         "MODELTRANSLATION_LANGUAGES",
#         (val for val, label in settings.LANGUAGES),
#     )
# )
# DEFAULT_LANGUAGE = getattr(settings, "MODELTRANSLATION_DEFAULT_LANGUAGE", None)
#     DEFAULT_LANGUAGE = AVAILABLE_LANGUAGES[0]
# PREPOPULATE_LANGUAGE = getattr(settings, "MODELTRANSLATION_PREPOPULATE_LANGUAGE", None)
# CUSTOM_FIELDS = getattr(settings, "MODELTRANSLATION_CUSTOM_FIELDS", ())
# ENABLE_REGISTRATIONS = getattr(settings, "MODELTRANSLATION_ENABLE_REGISTRATIONS", settings.USE_I18N)
# DEBUG = getattr(settings, "MODELTRANSLATION_DEBUG", False)
# AUTO_POPULATE = getattr(settings, "MODELTRANSLATION_AUTO_POPULATE", False)
# FALLBACK_LANGUAGES = getattr(settings, "MODELTRANSLATION_FALLBACK_LANGUAGES", (DEFAULT_LANGUAGE,))
#     FALLBACK_LANGUAGES = {"default": tuple(FALLBACK_LANGUAGES)}
# ENABLE_FALLBACKS = getattr(settings, "MODELTRANSLATION_ENABLE_FALLBACKS", True)
# LOADDATA_RETAIN_LOCALE = getattr(settings, "MODELTRANSLATION_LOADDATA_RETAIN_LOCALE", True)
# JQUERY_URL = getattr(
#     settings,
#     "JQUERY_URL",
#     "//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js",
# )
# JQUERY_UI_URL = getattr(
#     settings,
#     "JQUERY_UI_URL",
#     "//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js",
# )


from contextlib import contextmanager
from django.utils.encoding import force_str
from django.utils.translation import get_language as _get_language
from django.utils.translation import get_language_info
from django.utils.functional import lazy
from modeltranslation import settings
import six
# -*- coding: utf-8 -*-




def get_language():
    """
    Return an active language code that is guaranteed to be in
    settings.LANGUAGES (Django does not seem to guarantee this for us).
    """
    lang = _get_language()
    if lang is None:  # Django >= 1.8

# Path: modeltranslation/settings.py
# TRANSLATION_FILES = tuple(getattr(settings, "MODELTRANSLATION_TRANSLATION_FILES", ()))
# AVAILABLE_LANGUAGES = list(
#     getattr(
#         settings,
#         "MODELTRANSLATION_LANGUAGES",
#         (val for val, label in settings.LANGUAGES),
#     )
# )
# DEFAULT_LANGUAGE = getattr(settings, "MODELTRANSLATION_DEFAULT_LANGUAGE", None)
#     DEFAULT_LANGUAGE = AVAILABLE_LANGUAGES[0]
# PREPOPULATE_LANGUAGE = getattr(settings, "MODELTRANSLATION_PREPOPULATE_LANGUAGE", None)
# CUSTOM_FIELDS = getattr(settings, "MODELTRANSLATION_CUSTOM_FIELDS", ())
# ENABLE_REGISTRATIONS = getattr(settings, "MODELTRANSLATION_ENABLE_REGISTRATIONS", settings.USE_I18N)
# DEBUG = getattr(settings, "MODELTRANSLATION_DEBUG", False)
# AUTO_POPULATE = getattr(settings, "MODELTRANSLATION_AUTO_POPULATE", False)
# FALLBACK_LANGUAGES = getattr(settings, "MODELTRANSLATION_FALLBACK_LANGUAGES", (DEFAULT_LANGUAGE,))
#     FALLBACK_LANGUAGES = {"default": tuple(FALLBACK_LANGUAGES)}
# ENABLE_FALLBACKS = getattr(settings, "MODELTRANSLATION_ENABLE_FALLBACKS", True)
# LOADDATA_RETAIN_LOCALE = getattr(settings, "MODELTRANSLATION_LOADDATA_RETAIN_LOCALE", True)
# JQUERY_URL = getattr(
#     settings,
#     "JQUERY_URL",
#     "//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js",
# )
# JQUERY_UI_URL = getattr(
#     settings,
#     "JQUERY_UI_URL",
#     "//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js",
# )


# Path: modeltranslation/utils.py
from contextlib import contextmanager
from django.utils.encoding import force_str
from django.utils.translation import get_language as _get_language
from django.utils.translation import get_language_info
from django.utils.functional import lazy
from modeltranslation import settings
import six

# -*- coding: utf-8 -*-




def get_language():
    """
    Return an active language code that is guaranteed to be in
    settings.LANGUAGES (Django does not seem to guarantee this for us).
    """
    lang = _get_language()
    if lang is None:  # Django >= 1.8

        return settings.DEFAULT_LANGUAGE