{% load i18n %}

{% load smart_settings_tags %}

{% smart_setting 'APPEARANCE_MAXIMUM_TITLE_LENGTH' as maximum_title_length %}

{# Avoid horizontal scroll on small displays #}
{% if not html_title %}
    <span style="word-break: break-all;">
{% endif %}

    {% if title %}
        {{ title|truncatechars:maximum_title_length }}
    {% else %}
        {% if read_only %}
            {% blocktrans %}Details for: {{ object }}{% endblocktrans %}
        {% else %}
            {% if object %}
                {% blocktrans with object as object %}Edit: {{ object }}{% endblocktrans %}
            {% else %}
                {% trans 'Create' %}
            {% endif %}
        {% endif %}
    {% endif %}

{% if not html_title %}
    </span>
{% endif %}
