summaryrefslogtreecommitdiff
path: root/_includes/extensions/google-translate.html
blob: 5eacacf4854b10c00867f444d7960e6cf2cd3396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{% if include.translate_langs %}
  {% assign translate_langs = include.translate_langs %}
{% endif %}

{% if include.lang %}
  {% assign lang = include.lang %}
{% endif %}

<div id="google_translate_element" style="display: none;">
</div>

<span class="ct-language">
  <ul class="list-unstyled ct-language-dropdown">
    {% for item in translate_langs %}
      <li>
	  {% if item.lang == 'es' %}
	    {% capture page_url %}{{ site.baseurl_root }}{{ page.url }}{% endcapture %}
	  {% else %}
	    {% capture page_url %}{{ site.baseurl_root }}/{{ item.lang }}{{ page.url}}{% endcapture %}
	  {% endif %}
          <a href="{{ page_url }}" class="lang-select">
            {% if item.img %}
            <img src="{{ item.img }}" title="{{ item.text }}">
          {% else %}
            {{ item.text }}
          {% endif %}
        </a>
      </li>
    {% endfor %}
  </ul>
</span>