# Path: modeltranslation/settings.py
# AVAILABLE_LANGUAGES = list(
#     getattr(
#         settings,
#         "MODELTRANSLATION_LANGUAGES",
#         (val for val, label in settings.LANGUAGES),
#     )
# )
# 
# Path: modeltranslation/translator.py
# class AlreadyRegistered(Exception):
# class NotRegistered(Exception):
# class DescendantRegistered(Exception):
# class FieldsAggregationMetaClass(type):
# class TranslationOptions(with_metaclass(FieldsAggregationMetaClass, object)):
# class MultilingualOptions(options.Options):
#         class NewMultilingualManager(
#             MultilingualManager, manager.__class__, MultilingualQuerysetManager
#         ):
#     class NewSingleObjectDescriptor(LanguageCacheSingleObjectDescriptor, ro_descriptor.__class__):
# class Translator(object):
#     def __new__(cls, name, bases, attrs):
#     def __init__(self, model):
#     def validate(self):
#     def _check_languages(self, languages, extra=()):
#     def update(self, other):
#     def add_translation_field(self, field, translation_field):
#     def get_field_names(self):
#     def __str__(self):
#     def base_manager(self):
# def add_translation_fields(model, opts):
# def has_custom_queryset(manager):
# def patch_manager_class(manager):
#             def deconstruct(self):
#             def __hash__(self):
#             def __eq__(self, other):
# def add_manager(model):
# def patch_constructor(model):
#     def new_init(self, *args, **kwargs):
# def delete_mt_init(sender, instance, **kwargs):
# def patch_clean_fields(model):
#     def new_clean_fields(self, exclude=None):
# def patch_get_deferred_fields(model):
#     def new_get_deferred_fields(self):
# def patch_refresh_from_db(model):
#     def new_refresh_from_db(self, using=None, fields=None):
# def delete_cache_fields(model):
# def populate_translation_fields(sender, kwargs):
# def patch_related_object_descriptor_caching(ro_descriptor):
#     def __init__(self):
#     def register(self, model_or_iterable, opts_class=None, **options):
#     def _register_single_model(self, model, opts):
#     def unregister(self, model_or_iterable):
#     def get_registered_models(self, abstract=True):
#     def _get_options_for_model(self, model, opts_class=None, **options):
#     def get_options_for_model(self, model):
# 
# Path: modeltranslation/utils.py
# def build_localized_fieldname(field_name, lang):
#     if lang == 'id':
#         # The 2-letter Indonesian language code is problematic with the
#         # current naming scheme as Django foreign keys also add "id" suffix.
#         lang = 'ind'
#     return str('%s_%s' % (field_name, lang.replace('-', '_')))


from django import VERSION
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import connection
from six import moves
from modeltranslation.settings import AVAILABLE_LANGUAGES
from modeltranslation.translator import translator
from modeltranslation.utils import build_localized_fieldname
        from optparse import make_option

        option_list = BaseCommand.option_list + (
            make_option(
                '--noinput',
                action='store_false',
                dest='interactive',
                default=True,
                help='Do NOT prompt the user for input of any kind.',
            ),
        )
    else:

        def add_arguments(self, parser):
            parser.add_argument(
                '--noinput',
                action='store_false',
                dest='interactive',
                default=True,
                help='Do NOT prompt the user for input of any kind.',
            ),

    def handle(self, *args, **options):
        """
        Command execution.
        """
        self.cursor = connection.cursor()
        self.introspection = connection.introspection
        self.interactive = options['interactive']

        found_missing_fields = False

# Path: modeltranslation/settings.py
# AVAILABLE_LANGUAGES = list(
#     getattr(
#         settings,
#         "MODELTRANSLATION_LANGUAGES",
#         (val for val, label in settings.LANGUAGES),
#     )
# )
# 
# Path: modeltranslation/translator.py
# class AlreadyRegistered(Exception):
# class NotRegistered(Exception):
# class DescendantRegistered(Exception):
# class FieldsAggregationMetaClass(type):
# class TranslationOptions(with_metaclass(FieldsAggregationMetaClass, object)):
# class MultilingualOptions(options.Options):
#         class NewMultilingualManager(
#             MultilingualManager, manager.__class__, MultilingualQuerysetManager
#         ):
#     class NewSingleObjectDescriptor(LanguageCacheSingleObjectDescriptor, ro_descriptor.__class__):
# class Translator(object):
#     def __new__(cls, name, bases, attrs):
#     def __init__(self, model):
#     def validate(self):
#     def _check_languages(self, languages, extra=()):
#     def update(self, other):
#     def add_translation_field(self, field, translation_field):
#     def get_field_names(self):
#     def __str__(self):
#     def base_manager(self):
# def add_translation_fields(model, opts):
# def has_custom_queryset(manager):
# def patch_manager_class(manager):
#             def deconstruct(self):
#             def __hash__(self):
#             def __eq__(self, other):
# def add_manager(model):
# def patch_constructor(model):
#     def new_init(self, *args, **kwargs):
# def delete_mt_init(sender, instance, **kwargs):
# def patch_clean_fields(model):
#     def new_clean_fields(self, exclude=None):
# def patch_get_deferred_fields(model):
#     def new_get_deferred_fields(self):
# def patch_refresh_from_db(model):
#     def new_refresh_from_db(self, using=None, fields=None):
# def delete_cache_fields(model):
# def populate_translation_fields(sender, kwargs):
# def patch_related_object_descriptor_caching(ro_descriptor):
#     def __init__(self):
#     def register(self, model_or_iterable, opts_class=None, **options):
#     def _register_single_model(self, model, opts):
#     def unregister(self, model_or_iterable):
#     def get_registered_models(self, abstract=True):
#     def _get_options_for_model(self, model, opts_class=None, **options):
#     def get_options_for_model(self, model):
# 
# Path: modeltranslation/utils.py
# def build_localized_fieldname(field_name, lang):
#     if lang == 'id':
#         # The 2-letter Indonesian language code is problematic with the
#         # current naming scheme as Django foreign keys also add "id" suffix.
#         lang = 'ind'
#     return str('%s_%s' % (field_name, lang.replace('-', '_')))


# Path: modeltranslation/management/commands/sync_translation_fields.py
from django import VERSION
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.db import connection
from six import moves
from modeltranslation.settings import AVAILABLE_LANGUAGES
from modeltranslation.translator import translator
from modeltranslation.utils import build_localized_fieldname
        from optparse import make_option


        option_list = BaseCommand.option_list + (
            make_option(
                '--noinput',
                action='store_false',
                dest='interactive',
                default=True,
                help='Do NOT prompt the user for input of any kind.',
            ),
        )
    else:

        def add_arguments(self, parser):
            parser.add_argument(
                '--noinput',
                action='store_false',
                dest='interactive',
                default=True,
                help='Do NOT prompt the user for input of any kind.',
            ),

    def handle(self, *args, **options):
        """
        Command execution.
        """
        self.cursor = connection.cursor()
        self.introspection = connection.introspection
        self.interactive = options['interactive']

        found_missing_fields = False

        models = translator.get_registered_models(abstract=False)