Skip to content

Commit

Permalink
Add model translation for FormPage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Mar 8, 2020
1 parent 2458820 commit 5dc3abb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mpicms/base/translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -43,3 +46,10 @@ class PhonelistPageTR(TranslationOptions):
fields = (
)

@register(FormPage)
class FormPageTR(TranslationOptions):
fields = (
'sidebar',
'intro',
'thank_you_text',
)

0 comments on commit 5dc3abb

Please sign in to comment.