{% extends "wiki/base.html" %} {% from "layout/errorlist.html" import errorlist %} {% from "wiki/includes/sidebar_modules.html" import document_tools with context %} {% from "includes/common_macros.html" import content_editor with context %} {% from "wiki/includes/document_macros.html" import revision_diff, submit_revision, edit_messages with context %} {% from "wiki/includes/document_macros.html" import document_lock_warning with context %} {% set title = _('Translate Article | {document}')|f(document=parent.title) %} {% set crumbs = [(parent.get_absolute_url(), parent.title), (None, _('Translate Article'))] %} {% set classes = 'translate' %} {% set scripts = ('wiki', 'wiki.diff', 'wiki.editor') %} {% if document.is_switching_devices_document %} {% set scripts = scripts + ('switching-devices',) %} {% endif %} {% set ga_content_group = "kb-cms" %} {% block content %} {% set language = settings.LANGUAGES_DICT[locale.lower()] %}

{{ _('Translating {title}')|f(title=parent.title) }}

{{ _('Translating article to {locale}.' )|f(locale=language) }}

{% if not document %} {# If this is the first translation to this locale, we use 1 big form. #}
{% csrf_token %} {% endif %} {% if document_form %}
{{ _('Translate Description') }}
{{ errorlist(document_form) }} {% if document %} {# If there are existing translations in this locale, we use 2 separate forms. #} {% csrf_token %} {% endif %}
  • {{ parent.title }}
    {{ document_form.title|safe }}
  • {{ parent.slug }}

    {{ document_form.slug|safe }}
  • {{ document_form.allow_discussion }}
{% if document %}
{% endif %}
{% endif %} {% if revision_form %}
{{ _('Translate Content') }}
{{ errorlist(revision_form) }} {% if document %} {# If there are existing translations in this locale, we use 2 separate forms. #}
{% csrf_token %} {# Do not add a closing form tag here it is added below #} {% endif %} {% if recent_approved_revs %}

{{ _('Recently approved updates') }}:

{% endif %}

{{ _('Differences') }}:

{% if document.current_revision and document.current_revision.based_on and parent.latest_localizable_revision %} {# Diff between the English version the current translation is based on and the most recent ready-to-localize English version. #} {{ revision_diff(document.current_revision.based_on, parent.latest_localizable_revision, show_picker=True) }} {% elif not parent.latest_localizable_revision %}

{{ _('Note: This article has no revisions ready for localization.') }}

{% else %}

{{ _('Note: There are no approved translations for this article.') }}

{% endif %}
  • {{ based_on.keywords }}
    {{ revision_form.keywords|safe }}
  • {{ based_on.summary }}
    {{ revision_form.summary|safe }}

    {{ revision_form.summary.field.max_length }} {{_('characters remaining.') }}

{{ _('{locale} translation:')|f(locale=language) }}

{{ content_editor(revision_form.content) }}
{{ revision_form.hidden_fields()|join|safe }}
{# If the document has been created and has a current revision, we allow the localizer to keep the translation out of date with this new revision. #} {{ submit_revision(revision_form, show_no_update_checkbox=(document and document.current_revision), include_diff=True, translate=True) }}
{{ revision_form.content.value() }}
{{ submit_revision(revision_form, buttons_only=True, include_diff=True, translate=True) }}
{% if document %}
{% endif %}
{% endif %} {% if not document %} {% endif %}
{% endblock %} {% block side %} {{ document_tools(document, parent, user, 'edit', settings) }} {% endblock %}