Open bookhankaa opened 6 years ago
from modeltranslation.translator import translator, TranslationOptions
from mezzanine.pages.models import RichTextPage
class TranslatedInjectedPage(TranslationOptions):
fields = ('quote',),
translator.unregister(RichTextPage)
translator.register(RichTextPage, TranslatedInjectedPage)
All fields and quote field transleted, content field NOT transleted.
And just simple:
from modeltranslation.translator import translator
from mezzanine.pages.translation import TranslatedRichTextPage
from mezzanine.pages.models import RichTextPage
translator.unregister(RichTextPage)
translator.register(RichTextPage, TranslatedRichTextPage)
Doesn't works with error:
Model 'RichTextPage' already contains a field named 'content_en'.
I have a similar problem - running version from master, commit aea2e994f429eedd2c304bd6895ee7e024c22ba0
Me too
same here, 4.3.0 stable.
This is a bug of django-modeltranslation that never got addressed.
One workaround would be to manually add translated fields using EXTRA_MODEL_FIELDS
for each target language.
Following for this section of manual Translation for Injected Fields I'm trying to add translated extrafield for RichTextPage model: settings.py
translation.py
and I get: