I'm working on a Django CMS with content to be translated into multiple languages. I'm using django-parler.
To make the translations easier I would like to have the text from the default language visible when adding the translated text, preferable just above the input field/textarea.
Any ideas on how to solve it?
You can override the
get_form
method in the Admin class, and update the widgetsplaceholder
attribute. For example, if I have the folllowing model:Then I can use
Where
de
is my default language, and the fieldsseries
andskill
are translatable fields.Now this creates
placeholders
, which will disappear when typing, alternatively you can use:To get the actuall value there, such that you can directly save it.
Now if you don't want to keep track of the translatable fields yourself, you can use:
Which will get you all translatable fields.
Note:
value
won't work onmodels.TextField