{% load i18n %}
{% load static spider_base %}

{% get_current_language as LANGUAGE_CODE %}
{% language "en" %}
<form action="{% url 'set_language' %}" method="post" name="language_selector_box">
  {% csrf_token %}
  <input name="next" type="hidden" value="{{request.get_full_path}}">
  <select name="language" onchange="this.form.submit()" {{attrs}}>
      {% get_available_languages as LANGUAGES %}
      {% get_language_info_list for LANGUAGES as languages %}
      {% for language in languages %}
          <option value="{{language.code}}"{% if language.code == LANGUAGE_CODE %} selected{% endif %}>
              {{ language.name_local }} ({{ language.code }})
          </option>
      {% endfor %}
  </select>
</form>
{% endlanguage %}
