{% load i18n pages_tags %}
<div class="language_choice_widget">
    <input id="id_language" name="language" type="hidden" value="{{ value }}" />
    <ul>
    {% for lang in page_languages %}
        {% ifequal value lang.0 %}
            <li><span class="current">{{ lang.0 }}</span></li>
        {% else %}
            {% if page|has_content_in:lang.0 %}
                <li><a class="editlink js-confirm-change" href="?language={{ lang.0 }}">{{ lang.0 }}</a></li>
            {% else %}
                <li><a class="addlink js-confirm-change" href="?language={{ lang.0 }}">{{ lang.0 }}</a></li>
            {% endif %}
        {% endifequal %}
    {% endfor %}
    </ul>
    {% if page|has_content_in:value %}
        <p style="clear:both"><a class="deletelink js-confirm-delete" 
        href="/admin/pages/page/{{ page.id }}/delete-content/{{ language }}/">{% trans "Delete this translation" %}</a></p>
    {% endif %}
</div>
