{# vim: set ts=2 et sts=2 sw=2: #} {% extends "wiki/base.html" %} {% from "layout/errorlist.html" import errorlist %} {% from "wiki/includes/sidebar_modules.html" import document_tabs %} {% from "includes/common_macros.html" import content_editor %} {% from "wiki/includes/document_macros.html" import revision_diff, submit_revision, edit_messages with context %} {% set title = _('Translate Article | {document}')|f(document=parent.title) %} {% set crumbs = [(url('wiki.category', parent.category), parent.get_category_display()), (parent.get_absolute_url(), parent.title), (None, _('Translate Article'))] %} {% set classes = 'translate' %} {% block content %} {% set language = settings.LANGUAGES[locale.lower()] %}

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

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

{% if not based_on.is_ready_for_localization %}
{{ _('You are translating an English document which is not yet ready for localization.') }}
{% endif %}
    {% for lcl in settings.LANGUAGE_CHOICES %} {% if lcl[0] not in [settings.WIKI_DEFAULT_LANGUAGE, locale] %}
  • {{ lcl[0] }}
  • {% endif %} {% endfor %}
{{ edit_messages() }} {% if not document %} {# If this is the first translation to this locale, we use 1 big form. #}
{{ csrf() }} {% 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() }} {% endif %}
  • {{ _('Title:') }}

    {{ parent.title }}

    {{ document_form.title|safe }}
  • {{ _('Slug:') }}

    {{ parent.slug }}

    {{ document_form.slug|safe }}
  • {{ document_form.allow_discussion|label_with_help }}{{ 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() }} {% endif %}
  • {{ _('Keywords:') }}

    {{ based_on.keywords }}

    {{ revision_form.keywords|safe }}
  • {{ _('Search result summary:') }}

    {{ based_on.summary }}

    {{ revision_form.summary|safe }}
{% 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 %}

    {{ _('Approved {default_locale} version:')|f(default_locale=settings.LANGUAGES[settings.WIKI_DEFAULT_LANGUAGE.lower()]) }}

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

    {{ content_editor(revision_form.content) }}
{{ revision_form.hidden_fields()|join|safe }}
{{ submit_revision(revision_form) }}
{{ submit_revision(revision_form, buttons_only=True) }}
{% if document %}
{% endif %}
{% endif %} {% if not document %} {% endif %}
{% endblock %} {% block side_top %} {{ document_tabs(document, parent, user, 'localize', settings) }} {% endblock %} {% block side_promos %}{% endblock %}