# 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
# @contextmanager
# def auto_populate(mode='all'):
#     """
#     Overrides translation fields population mode (population mode decides which
#     unprovided translations will be filled during model construction / loading).
# 
#     Example:
# 
#         with auto_populate('all'):
#             s = Slugged.objects.create(title='foo')
#         s.title_en == 'foo' // True
#         s.title_de == 'foo' // True
# 
#     This method may be used to ensure consistency loading untranslated fixtures,
#     with non-default language active:
# 
#         with auto_populate('required'):
#             call_command('loaddata', 'fixture.json')
#     """
#     current_population_mode = settings.AUTO_POPULATE
#     settings.AUTO_POPULATE = mode
#     try:
#         yield
#     finally:
#         settings.AUTO_POPULATE = current_population_mode


from django import VERSION
from django.core.management.commands.loaddata import Command as LoadDataCommand
from modeltranslation import settings as mt_settings
from modeltranslation.utils import auto_populate
        from optparse import make_option
            from django.utils import translation
            from django.utils import translation
        import argparse
    else:

        class CheckAction(argparse.Action):
            def __call__(self, parser, namespace, value, option_string=None):
                check_mode(self, option_string, value, parser, namespace)

        def add_arguments(self, parser):
            super(Command, self).add_arguments(parser)
            parser.add_argument(
                '--populate',
                action=self.CheckAction,
                type=str,
                dest='populate',
                metavar='MODE',
                help=self.help,
            )

    def __init__(self):
        super(Command, self).__init__()
        if mt_settings.LOADDATA_RETAIN_LOCALE and VERSION < (1, 6):

            self.locale = translation.get_language()

    def handle(self, *fixture_labels, **options):
        if hasattr(self, 'locale'):

            translation.activate(self.locale)

        mode = options.get('populate')
        if mode is not None:

# 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
# @contextmanager
# def auto_populate(mode='all'):
#     """
#     Overrides translation fields population mode (population mode decides which
#     unprovided translations will be filled during model construction / loading).
# 
#     Example:
# 
#         with auto_populate('all'):
#             s = Slugged.objects.create(title='foo')
#         s.title_en == 'foo' // True
#         s.title_de == 'foo' // True
# 
#     This method may be used to ensure consistency loading untranslated fixtures,
#     with non-default language active:
# 
#         with auto_populate('required'):
#             call_command('loaddata', 'fixture.json')
#     """
#     current_population_mode = settings.AUTO_POPULATE
#     settings.AUTO_POPULATE = mode
#     try:
#         yield
#     finally:
#         settings.AUTO_POPULATE = current_population_mode


# Path: modeltranslation/management/commands/loaddata.py
from django import VERSION
from django.core.management.commands.loaddata import Command as LoadDataCommand
from modeltranslation import settings as mt_settings
from modeltranslation.utils import auto_populate
        from optparse import make_option
            from django.utils import translation
            from django.utils import translation
        import argparse

    else:

        class CheckAction(argparse.Action):
            def __call__(self, parser, namespace, value, option_string=None):
                check_mode(self, option_string, value, parser, namespace)

        def add_arguments(self, parser):
            super(Command, self).add_arguments(parser)
            parser.add_argument(
                '--populate',
                action=self.CheckAction,
                type=str,
                dest='populate',
                metavar='MODE',
                help=self.help,
            )

    def __init__(self):
        super(Command, self).__init__()
        if mt_settings.LOADDATA_RETAIN_LOCALE and VERSION < (1, 6):

            self.locale = translation.get_language()

    def handle(self, *fixture_labels, **options):
        if hasattr(self, 'locale'):

            translation.activate(self.locale)

        mode = options.get('populate')
        if mode is not None:

            with auto_populate(mode):