{% load translations %}
{% load i18n %}
<footer class="flip pull-left">
 <ul>
  <li>{% blocktrans %}Powered by {{ weblate_version_link }}{% endblocktrans %}</li>
  <li><a href="{% url 'about' %}">{% blocktrans %}About Weblate{% endblocktrans %}</a></li>
  {% if has_legal %}<li><a href="{% url 'legal:index' %}">{% trans "Legal" %}</a></li>{% endif %}
  {% if status_url %}<li><a href="{{ status_url }}">{% trans "Service status" %}</a></li>{% endif %}
  <li><a href="{% url 'contact' %}">{% trans "Contact" %}</a></li>
  <li><a href="{% documentation 'user/index' %}">{% trans "Documentation" %}</a></li>
  <li><a href="{{ donate_url }}">{% trans "Donate to Weblate" %}</a></li>
 </ul>
</footer>

{% if piwik_site_id and piwik_url %}
<!-- Matomo -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['setCustomVariable', 1, 'Language', '{{ LANGUAGE_CODE }}', 'page']);
  {% if project %}
  _paq.push(['setCustomVariable', 2, 'Project', '{{ project.name }}', 'page']);
  {% endif %}
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//{{ piwik_url }}/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', {{ piwik_site_id }}]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//{{ piwik_url }}/piwik.php?idsite={{ piwik_site_id }}" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
{% endif %}

{% if google_analytics_id %}
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', '{{ google_analytics_id }}', 'auto');
  ga('send', 'pageview', {
  {% if project %}
    'dimension2':  '{{ project.name }}',
  {% endif %}
    'dimension1':  '{{ LANGUAGE_CODE }}'
  });

</script>
{% endif %}
