Sha256: abbcaa0fa5635ec17682c421140190628cc19abc6a2c766e7aecee02a3cbddeb

Contents?: true

Size: 947 Bytes

Versions: 2

Compression:

Stored size: 947 Bytes

Contents

<a href="javascript:switchLang()" class="lang-switcher mt-1">
  <span class="flag-icon flag-icon-squared" id="lang-switcher"></span>
</a>

<script type="text/javascript">
  if (!window.location.href.includes('grupopv')) {
    document.querySelector('.lang-switcher').classList.add('d-none');
  }

  currentLang = document.getElementsByTagName("html")[0].getAttribute("lang");

  if (currentLang == 'en') {
    document.querySelector('#lang-switcher').classList.add('flag-icon-mx');
  } else {
    document.querySelector('#lang-switcher').classList.add('flag-icon-us');
  }

  function switchLang(){
    if (currentLang == 'en') {
      url = window.location.href.replace('localhost:4000','grupopv.mx').replace('grupopv.us','grupopv.mx');
      window.location.href = url;
    } else {
      url = window.location.href.replace('localhost:4000','grupopv.us').replace('grupopv.mx','grupopv.us');
      window.location.href = url;
    }
  }
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-theme-marketing-1.0.1 _includes/components/lang-switchers/two-langs.html
jekyll-theme-marketing-1.0.0 _includes/components/lang-switchers/two-langs.html