Open ozanteoman opened 4 years ago
Hi, if you are only want to translate title
, maybe you should only translate title?
class ProductTranslationOptions(TranslationOptions):
fields = ('title', )
required_languages = ('tr', 'ru', 'es', 'ar')
Like this. And if you want to keep stats for different languages, you should use different approch.
Thank you for answering @last-partizan .
Can you say that both title
and rating
is added in fields and only apply fallback
a specific field like title for django-modeltranslation
. Is it possible ?
I have used different approach , but if it possible ,I think that with working django-modeltranslation
is better.
You can try to use something like:
fallback_undefined = None
fallback_undefined = {'title': 'no title', 'rating': None}
Hi everybody , i think i have a big problem I keep fields like title , rating ,popularity ,... on Production Model. my
rating
andpopularity
fields are integer and they will be null when they are created. And side of model translation , i am using Fallback to avoid null fortitle
but i don't need fallback for rating , popularity , if they are null , fallback show other_language value which defined in tuple, but i want to shownull
valuesettings.py
here is translation.py