コード例 #1
0
"""Registering translated models for the ``hero_slider`` app."""
from simple_translation.translation_pool import translation_pool

from .models import (
    Nationality,
    NationalityTranslation,
    LinkType,
    LinkTypeTranslation,
    Person,
    PersonTranslation,
    Role,
    RoleTranslation,
)


translation_pool.register_translation(Nationality, NationalityTranslation)
translation_pool.register_translation(LinkType, LinkTypeTranslation)
translation_pool.register_translation(Person, PersonTranslation)
translation_pool.register_translation(Role, RoleTranslation)
"""Registering translated models for the ``multilingual_events`` app."""
from simple_translation.translation_pool import translation_pool

from . import models


translation_pool.register_translation(
    models.EventCategory, models.EventCategoryTitle)
translation_pool.register_translation(models.Event, models.EventTitle)
コード例 #3
0
"""Registering translated models for the ``hero_slider`` app."""
from simple_translation.translation_pool import translation_pool

from . import models


translation_pool.register_translation(
    models.SliderItem, models.SliderItemTitle)
translation_pool.register_translation(
    models.SliderItemCategory, models.SliderItemCategoryTitle)
コード例 #4
0
from cmsplugin_blog.models import Entry, EntryTitle
from simple_translation.translation_pool import translation_pool

translation_pool.register_translation(Entry, EntryTitle)
コード例 #5
0
"""Registering translated models for the ``cmsplugin_blog_seo_addons`` app."""
from simple_translation.translation_pool import translation_pool

from .models import SEOAddon, SEOAddonTranslation


translation_pool.register_translation(SEOAddon, SEOAddonTranslation)
コード例 #6
0
"""Registering translated models for the ``cmsplugin_blog_categories`` app."""
from simple_translation.translation_pool import translation_pool

from cmsplugin_blog_categories.models import Category, CategoryTitle


translation_pool.register_translation(Category, CategoryTitle)
コード例 #7
0
"""Registering translated models for the ``tagging_translated`` app."""
from simple_translation.translation_pool import translation_pool

from tagging.models import Tag

from .models import TagTitle


translation_pool.register_translation(Tag, TagTitle)
コード例 #8
0
from simple_translation.translation_pool import translation_pool

from wlansi_store import models

translation_pool.register_translation(models.Product, models.ProductTitle)
コード例 #9
0
"""Registration of models for simple-translation."""
from simple_translation.translation_pool import translation_pool

from document_library.models import (
    Document,
    DocumentCategory,
    DocumentCategoryTitle,
    DocumentTitle,
)


translation_pool.register_translation(Document, DocumentTitle)
translation_pool.register_translation(DocumentCategory, DocumentCategoryTitle)
コード例 #10
0
"""Registration of models for simple-translation."""
from simple_translation.translation_pool import translation_pool

from document_library.models import (
    Document,
    DocumentCategory,
    DocumentCategoryTitle,
    DocumentTitle,
)

translation_pool.register_translation(Document, DocumentTitle)
translation_pool.register_translation(DocumentCategory, DocumentCategoryTitle)
コード例 #11
0
"""Translations for the ``review`` app."""
from simple_translation.translation_pool import translation_pool

from . import models


translation_pool.register_translation(models.RatingCategory,
                                      models.RatingCategoryTranslation)
コード例 #12
0
ファイル: models.py プロジェクト: epicbagel/django-libs
from simple_translation.translation_pool import translation_pool

from ...models_mixins import (
    SimpleTranslationMixin,
    SimpleTranslationPublishedManager,
)


class DummyProfile(SimpleTranslationMixin, models.Model):
    """Just a dummy profile model for testing purposes."""
    user = models.ForeignKey('auth.User')
    dummy_field = models.CharField(
        verbose_name=_('Dummy Field'),
        max_length=128,
    )

    objects = SimpleTranslationPublishedManager()


class DummyProfileTranslation(models.Model):
    """Just a translation of the dummy profile."""
    dummy_translation = models.CharField(max_length=128)

    is_published = models.BooleanField(default=True)
    language = models.CharField(max_length=8, default='en')

    dummyprofile = models.ForeignKey(DummyProfile)


translation_pool.register_translation(DummyProfile, DummyProfileTranslation)
コード例 #13
0
"""Registration of models of the ``enquiry`` app."""
from simple_translation.translation_pool import translation_pool

from enquiry.models import (
    Answer,
    AnswerTrans,
    Enquiry,
    EnquiryTrans,
)


translation_pool.register_translation(Answer, AnswerTrans)
translation_pool.register_translation(Enquiry, EnquiryTrans)
コード例 #14
0
from cmsplugin_blog.models import Entry, EntryTitle
from simple_translation.translation_pool import translation_pool

translation_pool.register_translation(Entry, EntryTitle)

コード例 #15
0
from simple_translation.translation_pool import translation_pool

from treemenus.models import MenuItem
from models import MenuItemExt

translation_pool.register_translation(MenuItem, MenuItemExt)
コード例 #16
0
"""Registering translated models for the ``roadmap`` app."""
from simple_translation.translation_pool import translation_pool

from .models import Event, EventTranslation, Milestone, MilestoneTranslation


translation_pool.register_translation(Event, EventTranslation)
translation_pool.register_translation(Milestone, MilestoneTranslation)
コード例 #17
0
"""Registration of models for simple-translation."""
from simple_translation.translation_pool import translation_pool

from .models import NewsEntry, NewsEntryTitle


translation_pool.register_translation(NewsEntry, NewsEntryTitle)