コード例 #1
0
from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import HomePage, StandardPage
from .inlines import GettingStartedItems, IATIInActionFeaturedItems, IATIInActionItems


@register(HomePage)
class HomePageTR(TranslationOptions):
    """Class declaring which fields of the HomePage model to translate."""

    fields = HomePage.translation_fields
    required_languages = HomePage.required_languages


add_language_content_panels(HomePage)


@register(StandardPage)
class StandardPageTR(TranslationOptions):
    """Class declaring which fields of the StandardPage model to translate."""

    fields = StandardPage.translation_fields


add_language_content_panels(StandardPage)


@register(GettingStartedItems)
class GettingStartedItemsTR(TranslationOptions):
    """Class declaring which fields of the GettingStartedItems model to translate."""
コード例 #2
0
from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register

from home.translation_helper import add_language_content_panels
from .models import GuidanceAndSupportPage, GuidanceGroupPage, GuidancePage, KnowledgebaseIndexPage, KnowledgebasePage


@register(GuidanceAndSupportPage)
class GuidanceAndSupportPageTR(TranslationOptions):
    """Class declaring which fields of the GuidanceAndSupportPage model to translate."""

    fields = GuidanceAndSupportPage.translation_fields


add_language_content_panels(GuidanceAndSupportPage)


@register(GuidanceGroupPage)
class GuidanceGroupPageTR(TranslationOptions):
    """Class declaring which fields of the GuidanceGroupPage model to translate."""

    fields = GuidanceGroupPage.translation_fields


add_language_content_panels(GuidanceGroupPage)


@register(GuidancePage)
class GuidancePageTR(TranslationOptions):
    """Class declaring which fields of the GuidancePage model to translate."""
コード例 #3
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import NewsIndexPage, NewsPage, NewsCategory


@register(NewsIndexPage)
class NewsIndexPageTR(TranslationOptions):
    """A class to allow for the news index page translation fields to be autopopulated in the database."""

    fields = NewsIndexPage.translation_fields


add_language_content_panels(NewsIndexPage)


@register(NewsPage)
class NewsPageTR(TranslationOptions):
    """A class to allow for the news page translation fields to be autopopulated in the database."""

    fields = NewsPage.translation_fields


add_language_content_panels(NewsPage)


@register(NewsCategory)
class NewsCategoryTR(TranslationOptions):
    """A class to allow for the news category translation fields to be autopopulated in the database."""
コード例 #4
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import GetInvolvedPage
from .inlines import GetInvolvedItems


@register(GetInvolvedPage)
class GetInvolvedPageTR(TranslationOptions):
    """A class to allow for the get involved page translation fields to be autopopulated in the database."""

    fields = GetInvolvedPage.translation_fields


add_language_content_panels(GetInvolvedPage)


@register(GetInvolvedItems)
class GetInvolvedItemsTR(TranslationOptions):
    """Class declaring which fields of the GetInvolvedItems model to translate."""

    fields = GetInvolvedItems.translation_fields
コード例 #5
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import EventIndexPage, EventPage, EventType


@register(EventIndexPage)
class EventIndexPageTR(TranslationOptions):
    """A class to allow for the event index page translation fields to be autopopulated in the database."""

    fields = EventIndexPage.translation_fields


add_language_content_panels(EventIndexPage)


@register(EventPage)
class EventPageTR(TranslationOptions):
    """A class to allow for the event page translation fields to be autopopulated in the database."""

    fields = EventPage.translation_fields


add_language_content_panels(EventPage)


@register(EventType)
class EventTypeTR(TranslationOptions):
    """A class to allow for the event type snippet translation fields to be autopopulated in the database."""
コード例 #6
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import ContactPage


@register(ContactPage)
class ContactPageTR(TranslationOptions):
    """Class declaring which fields of the ContactPage model to translate."""

    fields = ContactPage.translation_fields


add_language_content_panels(ContactPage)
コード例 #7
0
    GuidanceGroupPage,
    GuidancePage,
    # KnowledgebaseIndexPage,
    # KnowledgebasePage,
    CommunityPage,
    SupportPage)


@register(GuidanceAndSupportPage)
class GuidanceAndSupportPageTR(TranslationOptions):
    """Class declaring which fields of the GuidanceAndSupportPage model to translate."""

    fields = GuidanceAndSupportPage.translation_fields


add_language_content_panels(GuidanceAndSupportPage)


@register(GuidanceGroupPage)
class GuidanceGroupPageTR(TranslationOptions):
    """Class declaring which fields of the GuidanceGroupPage model to translate."""

    fields = GuidanceGroupPage.translation_fields


add_language_content_panels(GuidanceGroupPage)


@register(GuidancePage)
class GuidancePageTR(TranslationOptions):
    """Class declaring which fields of the GuidancePage model to translate."""
コード例 #8
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import ToolsListingPage, ToolPage, ToolSubPage


@register(ToolsListingPage)
class ToolsListingPageTR(TranslationOptions):
    """A class to allow for the tools index page translation fields to be autopopulated in the database."""

    fields = ToolsListingPage.translation_fields


add_language_content_panels(ToolsListingPage)


@register(ToolPage)
class ToolPageTR(TranslationOptions):
    """A class to allow for the tool page translation fields to be autopopulated in the database."""

    fields = ToolPage.translation_fields


@register(ToolSubPage)
class ToolSubPageTR(TranslationOptions):
    """A class to allow for the tool sub-page translation fields to be autopopulated in the database."""

    fields = ToolSubPage.translation_fields
コード例 #9
0
from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import MembersAssemblyPage, Member
from .inlines import ChairItems, ViceChairItems


@register(MembersAssemblyPage)
class MembersAssemblyPageTR(TranslationOptions):
    """A class to allow for the members assembly page translation fields to be autopopulated in the database."""

    fields = MembersAssemblyPage.translation_fields
    required_languages = MembersAssemblyPage.required_languages


add_language_content_panels(MembersAssemblyPage)


@register(ChairItems)
class ChairItemsTR(TranslationOptions):
    """Class declaring which fields of the ChairItems model to translate."""

    fields = ChairItems.translation_fields


@register(ViceChairItems)
class ViceChairItemsTR(TranslationOptions):
    """Class declaring which fields of the ViceChairItems model to translate."""

    fields = ViceChairItems.translation_fields
コード例 #10
0
@register(IATIStandardPage)
class IATIStandardPageTR(TranslationOptions):
    """Class declaring which fields of the IATIStandardPage model to translate."""

    fields = IATIStandardPage.translation_fields


@register(ActivityStandardPage)
class ActivityStandardPageTR(TranslationOptions):
    """Class declaring which fields of the ActivityStandardPage model to translate."""

    fields = ActivityStandardPage.translation_fields


@register(StandardGuidanceIndexPage)
class StandardGuidanceIndexPageTR(TranslationOptions):
    """Class declaring which fields of the StandardGuidanceIndexPage model to translate."""

    fields = StandardGuidanceIndexPage.translation_fields


@register(StandardGuidancePage)
class StandardGuidancePageTR(TranslationOptions):
    """Class declaring which fields of the StandardGuidancePage model to translate."""

    fields = StandardGuidancePage.translation_fields


add_language_content_panels(IATIStandardPage)
add_language_content_panels(StandardGuidanceIndexPage)
コード例 #11
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import IATIStandardPage


@register(IATIStandardPage)
class IATIStandardPageTR(TranslationOptions):
    """Class declaring which fields of the IATIStandardPage model to translate."""

    fields = IATIStandardPage.translation_fields


add_language_content_panels(IATIStandardPage)
コード例 #12
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import UsingDataPage


@register(UsingDataPage)
class UsingDataPageTR(TranslationOptions):
    """Inheriting from AboutPage already comes with translations."""

    fields = list()


add_language_content_panels(UsingDataPage)
コード例 #13
0
"""Module for registering model fields for translation, for use by django-modeltranslation."""

from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register
from home.translation_helper import add_language_content_panels
from .models import UsingDataPage, ToolsIndexPage


@register(UsingDataPage)
class UsingDataPageTR(TranslationOptions):
    """Inheriting from AboutPage already comes with translations."""

    fields = list()


add_language_content_panels(UsingDataPage)


@register(ToolsIndexPage)
class ToolsIndexPageTR(TranslationOptions):
    """Inheriting from AbstractContentPage already comes with translations."""

    fields = ToolsIndexPage.translation_fields


add_language_content_panels(ToolsIndexPage)
コード例 #14
0
from modeltranslation.translator import TranslationOptions
from modeltranslation.decorators import register

from home.translation_helper import add_language_content_panels
from .models import AboutPage, AboutSubPage, CaseStudyIndexPage, CaseStudyPage, HistoryPage, PeoplePage


@register(AboutPage)
class AboutPageTR(TranslationOptions):
    """Class declaring which fields of the AboutPage model to translate."""

    fields = AboutPage.translation_fields


add_language_content_panels(AboutPage)


@register(AboutSubPage)
class AboutSubPageTR(TranslationOptions):
    """Class declaring which fields of the AboutSubPage model to translate."""

    fields = AboutSubPage.translation_fields


add_language_content_panels(AboutSubPage)


@register(CaseStudyIndexPage)
class CaseStudyIndexPageTR(TranslationOptions):
    """Class declaring which fields of the CaseStudyIndexPage model to translate."""