Answer the question
In order to leave comments, you need to log in
How to translate breadcrumbs in Django admin?
Hey!
I can't figure out how to translate "breadcrumb" in the Django admin.
Tried to use this and this .
But all in vain *(
There are two admin panels in the project. (1 - Admin admin panel, the second - Users.)
Plus - grapelli is connected.
It seems that the entire Django admin panel was translated, even I figured out the cases of the norms, but not breadcrumbs.
When inserting the code from the snippet, nothing does not happen. Tried to understand, deduce step by step. Still incomprehensible. *(
Are there GURUs who will undertake to explain?
Answer the question
In order to leave comments, you need to log in
Brr... I had a jamb in this method
def wrap(model_or_iterable, admin_class=None, **option):
if isinstance(model_or_iterable, ModelBase):
model_or_iterable = [model_or_iterable]
for model in model_or_iterable:
if model.__module__ != self.module:
continue
if admin_class is None:
admin_class = type(model.__name__+'Admin',
(admin.ModelAdmin,), {})
admin_class.add_view = rename_breadcrumbs(admin_class.add_view)
admin_class.change_view = rename_breadcrumbs(admin_class.change_view)
admin_class.changelist_view = rename_breadcrumbs(admin_class.changelist_view)
model._meta.app_label = self.string_with_realoaded_title(
self.native_app_label,
self.app_label)
return f(model, admin_class, **option)
return wrap
if model.__module__ != self.module:
continue
Doesn't roll
{% load i18n %}
and
{% trans value %}
in the template?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question