{% load i18n django_backend_tags %} {% if backend|has_translate_permission:user|for_object:object or backend|has_change_permission:user|for_object:object %} {% if backend.FEATURES.translatable and object.language != language_id %} {% if backend|has_translate_permission:user|for_object:object %} {% trans "Translate" %} {% endif %} {% else %} {% if backend|has_change_permission:user|for_object:object %} {% trans "Edit" %} {% endif %} {% endif %} {% else %} {% if backend|has_read_permission:user|for_object:object %} {% trans "Show" %} {% endif %} {% endif %} {% if backend.FEATURES.translatable %} {# Either we display translation links and the user has the translate permission ... #} {# ... or we display "show translation" links and the user has read permissions. #} {% if backend|has_translate_permission:user|for_object:object and object.untranslated_languages or backend|has_read_permission:user and object.translations.exists %} {% endif %} {% endif %}