def reset_extensions_translations_locales(apps, schema_editor):
 Extension = apps.get_model(u'extensions', u'Extension')
 Translation = apps.get_model(u'translations', u'Translation')
 extensions = Extension.objects.all()
 for extension in extensions:
  translations_ids = filter(None, [extension.name_id, extension.description_id])
  lang = extension.default_language.lower()
  Translation.objects.filter(id__in=translations_ids).update(locale=lang)

def reset_extensions_translations_locales ( apps , schema_editor ) : Extension = apps . get_model ( u'extensions' , u'Extension' ) Translation = apps . get_model ( u'translations' , u'Translation' ) extensions = Extension . objects . all ( ) for extension in extensions : translations_ids = filter ( None , [ extension . name_id , extension . description_id ] ) lang = extension . default_language . lower ( ) Translation . objects . filter ( id__in = translations_ids ) . update ( locale = lang )
reset the locale field for all translations on existing extensions .