I'm working on a bilingual site (spanish/english), I took the advice from the 2nd answer in this post.
This is the bit of code in the navbar that I use to pick a language:
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdown06" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span lang="es">Idioma</span>
<span lang="en">Language</span>
</a>
<div class="dropdown-menu" aria-labelledby="dropdown06">
<a class="dropdown-item coll-navbar language">
<span lang="es">English</span>
<span lang="en">Español</span>
</a>
</div>
</li>
And this is the js code:
$('[lang="en"]').hide();
$('.language').click(function() {
$('[lang="es"]').toggle();
$('[lang="en"]').toggle();
});
This is an example of the code implemented:
<div class="title col-12 col-md-8">
<h2 class="align-center" lang="es"><strong>
Costura</strong></h2>
<h2 class="align-center" lang="en"><strong>
Sewing</strong></h2>
</div>
And, it works great, the only problem is that when I choose the 2nd language and I change the html page, it returns to the first one (spanish in this case); how can I keep, when selected, the 2nd language across all the html's?
Thanks in advance,