Guide: Admin¶
This module provides an in depth knowledge of the Translations admin.
Make admin translatable¶
To make an admin translatable:
Make sure the admin model is translatable.
Inherit the admin from the
TranslatableAdmin
.from translations.admin import TranslatableAdmin, TranslationInline
class ContinentAdmin(TranslatableAdmin): inlines = [TranslationInline]
Add
TranslationInline
as its inline.from translations.admin import TranslatableAdmin, TranslationInline
class ContinentAdmin(TranslatableAdmin): inlines = [TranslationInline]
The TranslatableAdmin
should represent the values for
the default language, and
the TranslationInline
should represent the values for
the translation languages.
Note
An admin may contain an inline which itself needs to be translatable. Since translations appear as inlines to the admins, then the inlines themselves should have translation inlines in order to be translatable, and since Django does not support nested inlines there may be a need to use an external library. In that case check out How to: Integrate with custom admins.