# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals

from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _

from tenant_extras.middleware import tenant_translation
from bluebottle.clients.utils import LocalTenant

from bluebottle.clients.models import Client
from bluebottle.geo.models import Country
from bluebottle.bb_projects.models import ProjectTheme
from bluebottle.bb_projects.models import ProjectPhase
from bluebottle.tasks.models import Skill


def run():
    for tenant in Client.objects.all():
        with LocalTenant(tenant):
            activate('en')
            for model in [Country, ProjectTheme, ProjectPhase, Skill]:
                for obj in model.objects.all():
                    for translation in obj.translations.all():
                        activate(translation.language_code)
                        _trans._active.value = tenant_translation(
                            translation.language_code, connection.tenant.client_name
                        )
                        translation.name = _(translation.name)
                        print translation.name, translation.language_code
                        translation.save()

Add script that re-translates models
Add script that re-translates models
