django-modeltrans icon indicating copy to clipboard operation
django-modeltrans copied to clipboard

Add tabbed translation admin

Open julianwachholz opened this issue 1 year ago • 4 comments

This change adds simple tabbed UI for translated fields

Django Admin with tabbed translated fields

Important: The included JavaScript only supports Django 4.2 and up. I think it's a reasonable change as 3.2 is EOL soon (30 April 2024)

See also: https://github.com/zostera/django-modeltrans/issues/16#issuecomment-327216115

julianwachholz avatar Feb 20 '24 12:02 julianwachholz

Hi @jieter I added a small test and added the mixin to the example app as well as fixed all pending linter errors. Do you think this is ready to merge? This Admin integration would be the killer feature for this library I'm certain! :)

julianwachholz avatar Jun 14 '24 18:06 julianwachholz

Hey @jieter thanks for taking the time to have a look.

I agree with your sentiment that it's some completely new code that will have to be maintained in the future. I tried to keep it minimal using modern JS and no build step. The bulk of the code is required to synchronize the selected languages across all fields and supporting dynamically adding/removing inlines (i.e. fieldsets) in the Django Admin. I feel this sync feature allows for a much better editing experience for content moderators. Removing this feature would indeed get rid of a lot of code, but at the cost of UX.

One thing I thought about it that the Django Admin is by design a very slow moving thing, it has barely changed in the last decade. So keeping up to date with upstream is doable with relatively low effort (and I will gladly step up!).

PS: One thing I haven't mentioned is that the CSS variables referenced also support django-admin-interface

julianwachholz avatar Jul 02 '24 09:07 julianwachholz

@jieter do you have any thoughts?

julianwachholz avatar Jul 16 '24 09:07 julianwachholz

Hey @jieter it's been a while, do you not want to see this in django-modeltrans?

julianwachholz avatar Aug 13 '24 07:08 julianwachholz