Skip to content

Instantly share code, notes, and snippets.

@gowram
Created October 30, 2014 06:05
Show Gist options
  • Save gowram/f233ae63c97cbaa6dc22 to your computer and use it in GitHub Desktop.
Save gowram/f233ae63c97cbaa6dc22 to your computer and use it in GitHub Desktop.
{% load i18n parler_tags %}
<ul>
{% for lang_code, title in LANGUAGES %}
{% get_language_info for lang_code as lang %}
{% get_translated_url lang_code as tr_url %}
{% if tr_url %}<li{% if lang_code == LANGUAGE_CODE %} class="is-selected"{% endif %}><a href="{{ tr_url }}" hreflang="{{ lang_code }}">{{ lang.name_local|capfirst }}</a></li>{% endif %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment