Admin Integration¶
django-traduire provides a mixin that adds translation actions to the Django admin.
Setup¶
from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from django_traduire.admin import TraduireMixin
@admin.register(Article)
class ArticleAdmin(TraduireMixin, TranslationAdmin):
pass
Available actions¶
The mixin adds two actions to the admin changelist:
- Translate empty fields — fills only empty translation columns
- Translate all fields (overwrite) — retranslates everything, replacing existing translations
Usage¶
- Go to the admin changelist for your model
- Select the instances you want to translate
- Choose one of the translate actions from the action dropdown
- Click "Go"
The action shows a success message with the count of translated instances.