django-modeltrans
django-modeltrans copied to clipboard
Could not displayed translated fields when I assign `fields` in ModelAdmin
First of all I appreciate to make this lovely library.
Here is my question.
In default settings, I can see all translated fields.
But when I assign fields
in ModelAdmin like this.
class ProgramAdmin(admin.ModelAdmin):
model = Program
fields = ('title', ...)
Then, just one field displayed like below.
You don't mention what you expect to see.
The docs have an admin support page, mentioning the ActiveLanguageMixin
. It make sure only the default language and the current language are shown. Does that fix your usecase?
Oh I missed what I expect to see. Sorry.
I want to assign just title
into fieldsets
options in ModelAdmin.
Then I expect to see translate fields in admin like below.
Or, would I write all translate fields in fieldsets
like this?
fielddsets = (
('Basic', {
'fields': ('title', 'title_en_us', 'title_ko', 'title_zh_hant', 'title_zh_hans')
}),
)
This is inconvenient way to me. :(
I see. Interesting use case. But do you want to show all languages to the user always?
Yes I want.
I explain again because my previouse comments are little confused.
When I have title
and something
fields, I assign fieldsets
like below.
fieldsets = (
('Basic', {
'fields': ('title', 'something')
}),
)
Then, Django admin show me fields only title
and something
. There isn't title_en_us
or title_ko
.
I want to see all languages fields about title
.
Had same issue. I solved it by removing ActiveLanguageMixin
from my Admin class and using title_i18n
in fieldsets.