I've been trying to setup multilanguage option on my website. My site is onepage HTML based on bootstrap. I looked at the following code
function ChangeLanguage(selected) {
alert(selected.value()); // Do whatever you want in here.
}
<div class="btn-group dropdown pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
<span class="lang-sm lang-lbl-full" lang="en"></span> <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" >
<li><span class="lang-sm lang-lbl-full" onclick="ChangeLanguage(this)" lang="ar" value="ar"></span></li>
<li><span class="lang-sm lang-lbl-full" onclick="ChangeLanguage(this)" lang="en" value="en"></span></li>
<li><span class="lang-sm lang-lbl-full" onclick="ChangeLanguage(this)" lang="fr" value="fr"></span></li>
</ul>
</div>
I can't figure out how the calling of the other language works.
So my question is how do I call the right div(s) so that it would work.
If there are better ways of doing this other than using multiple divs I'm all ears.