From 5dc3abb95bb7447d47a64d17451482d50bfac797 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 8 Mar 2020 20:08:20 +0100 Subject: [PATCH] Add model translation for FormPage Add model translations for the FormPage but not yet for the FormField model, which doesn't work well, because the field name are translated along with the label and different sets of data would be saved depending on the user languages and different sets of data would be retrieved by the vsc export depending on the admin language. --- mpicms/base/translation.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mpicms/base/translation.py b/mpicms/base/translation.py index 30530c7..1d247a9 100644 --- a/mpicms/base/translation.py +++ b/mpicms/base/translation.py @@ -7,7 +7,10 @@ from modeltranslation.translator import TranslationOptions from modeltranslation.decorators import register -from .models import WikiPage, RootPage, HomePage, FeaturedImage, PhonelistPage +from .models import ( + WikiPage, RootPage, HomePage, FeaturedImage, PhonelistPage, + FormPage, FormField, +) @register(FeaturedImage) @@ -43,3 +46,10 @@ class PhonelistPageTR(TranslationOptions): fields = ( ) +@register(FormPage) +class FormPageTR(TranslationOptions): + fields = ( + 'sidebar', + 'intro', + 'thank_you_text', + )