mbi / django-front

Django-front is a front-end editing Django application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Admin overview page

busla opened this issue · comments

Are there plans to add a page in the admin with an overview of all translations? Perhaps the ability to edit translations there aswell?

Interesting question, I reckon it wouldn't be called django-front any longer? :)

Django-front doesn't actually support languages, i.e. it's only a matter of the context you pass to the template tag, which could be a LANGUAGE_CODE but could also be something entirely other. And the actual placeholder doesn't keep track of the passed arguments, just the hash of the sum of the arguments. So you couldn't say give me all the placeholder content bits for e.g. English.

All in all I would say no, as it defeats the purpose of front-end editing, and what you're trying to do is provided by more apter solutions such as e.g. django-cms

Ok, thanks mate. Great module, loving it.

Thanks, glad you like it. Sorry, maybe I failed to see the true motivation behind this issue, was it just a general idea or do you have a real use-case you would like to implement?

Anyway, if you want to see all the placeholders in the admin, you could stick this into an admin.py file:

from front.models import Placeholder
from django.contrib import admin
admin.site.register(Placeholder, list_display=('key', ))

this should get you a crude list of Placholders, but I'm afraid it'd be hard to know what you're editing.

Would that be both translated and untranslated?

Basically, I would like to get an overview of all untranslated versus translated. I´m using django-modeltranslation but it doesn´t offer the inline edit goodies that Django-Front does :-)

Ah no, that won't distinguish between languages, as I was saying before the "key" in a placeholder is just a sha1 hash of the "name" of the placeholder and the arguments you passed to the template tag, i.e. EN, FR, … but the actual arguments are lost, we only store the hash.

So you'll get a list of hashes, but no way to tell them apart.

If you want placeholders + language-based content + WYSIWYG editing you need a proper CMS, such as django-cms. Give it a try on e.g. http://www.aldryn.com/

Thanks mate.