mbi / django-rosetta

Rosetta is a Django application that eases the translation process of your Django projects
MIT License
1.07k stars 195 forks source link

Break dependency on the admin #228

Open alvra opened 5 years ago

alvra commented 5 years ago

This isn't really clear to me from the documentation, but it seems Rosetta requires the Django admin to be enabled for a few css files. The pages work ok, but lacks all styling.

Is it possible for Rosetta to provide a (minimal) version of these css files in case the admin is not enabled. Placing Rosetta lower than the admin in the INSTALLED_APPS will not override the admin css if it is enabled, or is there a way to avoid this?

As far as I can tell, only the following files are needed:

jayvdb commented 4 years ago

This would be useful for frameworks which include rosetta as part of a distinct admin-like dashboard, such as https://github.com/scaryclam/django-oscar-rosetta

bittner commented 4 years ago

I'd suggest to generalize this topic and call it "Separate Rosetta cleanly from Django Admin".

Why? – Because currently, Rosetta is not even cleanly integrated with the Admin:

If there were a clean separation it should be easy to allow for a Django setting to use either an integrated Django admin user experience, or a completely independent, stand-alone app appearance and behavior.

That would then potentially obsolete or replace settings like ROSETTA_SHOW_AT_ADMIN_PANEL.

balazs-endresz commented 1 month ago

Since the latest django admin comes with a dark theme I thought I try extending admin/base.html from rosetta/base.html and it was fairly straightforward to get it working and styled properly:

Screenshot of localhost_8000_rosetta_files_project_fr_0_ (1)

@mbi Would you accept a PR for that, or rather go in the opposite direction and have this completely decoupled from the django admin?

Btw, if someone doesn't want django admin in INSTALLED_APPS, then I guess they can also copy those three css files to their project's own static files.