    <link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
    <link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
    {% for code, label in translations|dictsort -%}
    <link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
    {% endfor -%}

    <link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
    <link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
    {% if translations %}
      {% for code, label in translations|dictsort -%}
      <link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
      {% endfor -%}
    {% endif %}

Fix issue with undefined translations variable.
Fix issue with undefined translations variable.

If the view doesn't use RequestContext the `translations`
variable won't exist, and the `dictsort` filter will raise
and exception.
