Translations
Forms for creating, modifying and configuring machine translations
Translations Management Form
- class integreat_cms.cms.forms.translations.translations_management_form.CustomCheckboxSelectMultiple(attrs=None, choices=())[source]
Bases:
CheckboxSelectMultiple
Custom CheckboxSelectMultiple child class which appends a machine translation provider to option labels or disables them if no provider is available
- class integreat_cms.cms.forms.translations.translations_management_form.TranslationLanguageOptions(language_tree_node: LanguageTreeNode)[source]
Bases:
object
Helper class to easily provide the translation providers for a language for form fields.
- Parameters:
language_tree_node (LanguageTreeNode)
- __init__(language_tree_node: LanguageTreeNode) None [source]
- Parameters:
language_tree_node (LanguageTreeNode)
- Return type:
None
- property choices: list[tuple[str, str]][source]
mt_providers
as list of tuples fordjango.forms.ChoiceField.choices
- property providers: dict[str, MachineTranslationProviderType][source]
mt_providers
as a dict, indexed byname
- class integreat_cms.cms.forms.translations.translations_management_form.TranslationsManagementForm(*args: Any, **kwargs: Any)[source]
Bases:
CustomModelForm
Form for modifying machine translation settings of a region
Form fields:
machine_translate_pages
: Pages (TypedChoiceField
)machine_translate_events
: Events (TypedChoiceField
)machine_translate_pois
: Locations (TypedChoiceField
)
- Parameters:
args (Any)
kwargs (Any)
- __init__(*args: Any, **kwargs: Any) None [source]
Initialize translations management form
- Parameters:
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- get_language_fields() Iterator[forms.ChoiceField] [source]
Generator for a
django.forms.ChoiceField
for each language with the available translation providers- Return type:
Iterator[forms.ChoiceField]
- property media[source]
Return all media required to render the widgets on this form.