code: def populate_translation_fields(sender, kwargs):
      
      populate = mt_settings.AUTO_POPULATE
      if not populate:
          return
      if populate is True:
          # What was meant by ``True`` is now called ``all``.
          populate = 'all'
  
      opts = translator.get_options_for_model(sender)
      for key, val in list(kwargs.items()):
          if key in opts.fields:
              if populate == 'all':
                  # Set the value for every language.
                  for translation_field in opts.fields[key]:
                      kwargs.setdefault(translation_field.name, val)
              elif populate == 'default':
                  default = build_localized_fieldname(key, mt_settings.DEFAULT_LANGUAGE)
                  kwargs.setdefault(default, val)
              elif populate == 'required':
                  default = build_localized_fieldname(key, mt_settings.DEFAULT_LANGUAGE)
                  if not sender._meta.get_field(key).null:
                      kwargs.setdefault(default, val)
              else:
                  raise AttributeError("Unknown population mode '%s'." % populate)
docs: When models are created or loaded from fixtures, replicates values
      provided for translatable fields to some / all empty translation fields,
      according to the current population mode.
  
      Population is performed only on keys (field names) present in kwargs.
      Nothing is returned, but passed kwargs dictionary is altered.
  
      With ``mode`` set to:
      -- ``all``: fills all translation fields, skipping just those for
         which a translated value is also provided;
      -- ``default``: fills only the default translation (unless it is
         additionally provided);
      -- ``required``: like ``default``, but only if the original field is
         non-nullable;
  
      At least the ``required`` mode should be used when loading untranslated
      fixtures to keep the database consistent (note that Django management
      commands are normally forced to run with hardcoded ``en-us`` language
      active). The ``default`` mode is useful if you need to ensure fallback
      values are available, and ``all`` if you need to have all translations
      defined (for example to make lookups / filtering without resorting to
      query fallbacks).