コード例 #1
0
ファイル: create_local_tm.py プロジェクト: KINFOO/pootle
    def handle_translation_project(self, tp, **options):
        """Push translation project units to local TM."""
        for store in tp.stores.iterator():
            self.stdout.write("Adding translations from %r" % (store))

            with transaction.atomic():
                for unit in Unit.objects.filter(store=store, state__gte=TRANSLATED).iterator():
                    tmunit = TMUnit().create(unit)
                    tmunit.save()
コード例 #2
0
ファイル: create_local_tm.py プロジェクト: shayanb/pootle
    def handle_translation_project(self, tp, **options):
        """Push translation project units to local TM."""
        for store in tp.stores.iterator():
            self.stdout.write("Adding translations from %r" % (store))

            with transaction.atomic():
                for unit in Unit.objects.filter(
                        store=store, state__gte=TRANSLATED).iterator():
                    tmunit = TMUnit().create(unit)
                    tmunit.save()
コード例 #3
0
ファイル: initdb.py プロジェクト: JeroenKnoops/pootle
def create_local_tm():
    """Create the local TM using translations from existing projects.

    Iterates over all the translation units and creates the corresponding local
    TM units.
    """
    logging.info('About to create local TM using existing translations')

    with transaction.commit_on_success():
        for unit in Unit.objects.filter(state__gte=TRANSLATED).iterator():
            tmunit = TMUnit().create(unit)
            tmunit.save()

        logging.info('Successfully created local TM from existing translations')
コード例 #4
0
ファイル: initdb.py プロジェクト: alexbriski/pootle
def create_local_tm():
    """Create the local TM using translations from existing projects.

    Iterates over all the translation units and creates the corresponding local
    TM units.
    """
    logging.info('About to create local TM using existing translations')

    with transaction.commit_on_success():
        for unit in Unit.objects.filter(state__gte=TRANSLATED).iterator():
            tmunit = TMUnit().create(unit)
            tmunit.save()

        logging.info('Successfully created local TM from existing translations')
コード例 #5
0
ファイル: pootle.py プロジェクト: Web5design/pootle
def upgrade_to_25200():
    """Post-upgrade actions for upgrades to 25200."""
    from django.db import transaction

    from pootle_store.models import TMUnit, Unit
    from pootle_store.util import TRANSLATED

    # Populate local TM from existing translation units.
    logging.info('About to create local TM using existing translations')

    with transaction.commit_on_success():
        for unit in Unit.objects.filter(state__gte=TRANSLATED).iterator():
            tmunit = TMUnit().create(unit)
            tmunit.save()

        logging.info('Succesfully created local TM from existing translations')