{% extends 'template_content/manage_localized_template_content.html' %} {% load i18n imagekit static localcosmos_tags template_content_tags %} {% block taxonomic_restriction %}{% endblock %} {% block form_action %}{% url 'translate_template_content' app.uid template_content.id language %}{% endblock %} {% block form %} {% if not localized_template_content %}
{% trans 'Before translating the components, you have to translate the title.' %}
{% endif %} {% for field in form %} {% if field.is_hidden %} {{ field }} {% else %}
{{ field.label }}
{# the field in the primary language #}
{{ app.primary_language }} {% if field.field.content_key %} {% with content_key=field.field.content_key content_definition=field.field.content_definition %} {% if field.field.allow_multiple == True %} {% if field.field.primary_locale_content %}
{% for primary_locale_content in field.field.primary_locale_content %} {% include 'template_content/ajax/primary_localization.html' %} {% endfor %}
{% else %}
{% trans 'There is no content that needs to be translated.' %}
{% endif %} {% else %}
{% with primary_locale_content=field.field.primary_locale_content %} {% include 'template_content/ajax/primary_localization.html' %} {% endwith %}
{% endif %} {% endwith %} {% else %} {% get_content form.template_content field.name app.primary_language as primary_locale_content %}
{% include 'template_content/ajax/primary_localization.html' %}
{% endif %}
{# the field for the translation of the above #}
{% if field.field.language %} {{ field.field.language }} {% endif %} {% if field.field.content_definition and field.field.content_definition.type == 'image' %}
{% if field.field.primary_locale_content.requires_translation %} {{ field }} {% else %}
{% trans 'This image does not require a translation. The image above (if any) will be used for all languages.' %}
{% endif %}
{% else %}
{{ field }}
{% if field.help_text %} {{ field.help_text|safe }} {% endif %} {% if field.errors %}
{% for error in field.errors %}{{ error }}
{% endfor %}
{% endif %} {% endif %}
{% endif %} {% endfor %} {% endblock %} {% block save_button_text %}{% trans 'save translation' %}{% endblock %}