Something went wrong on our end
-
borzechof99 authoredborzechof99 authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
translation.py 1.21 KiB
"""
Here, every Model which needs translation fields is registered.
"""
from modeltranslation.translator import register, TranslationOptions
from .models import Question, CallToMove, KnowledgeSnack
@register(Question)
class QuestionTranslationOptions(TranslationOptions):
"""
Translations for Question-model. Only the text of the question needs to be translated.
A German Translation is Required.
"""
fields = ("text",)
required_languages = ("de",)
fallback_values = ("No Translation for this Field",)
@register(CallToMove)
class CallToMoveTranslationOptions(TranslationOptions):
"""
Translations for CallToMove-model. Only the text of the call to move needs to be translated.
A German Translation is Required.
"""
fields = ("text",)
required_languages = ("de",)
fallback_values = ("No Translation for this Field",)
@register(KnowledgeSnack)
class KnowledgeSnackTranslationOptions(TranslationOptions):
"""
Translations for KnowledgeSnack-model. Only the text of the knowledge snack needs to be translated.
A German Translation is Required.
"""
fields = ("text",)
required_languages = ("de",)
fallback_values = ("No Translation for this Field",)