Skip to content

Instantly share code, notes, and snippets.

@tanrax
Created January 6, 2014 22:26
Show Gist options
  • Save tanrax/8290936 to your computer and use it in GitHub Desktop.
Save tanrax/8290936 to your computer and use it in GitHub Desktop.
JS: Gestion multidioma
<script src="lang/en.js" type="text/javascript"></script>
<script src="lang/es.js" type="text/javascript"></script>
<script type="text/javascript">
var sIdioma = 'en';
if(localStorage['idioma']) {
sIdioma = localStorage['idioma'];
}
$('#bandera').css('background-image', 'url("img/Flag-' + sIdioma + '.png")');
$("#text0").html(eval('sText0' + sIdioma));
$("#text1").html(eval('sText1' + sIdioma));
$("#text2").html(eval('sText2' + sIdioma));
$("#text3").html(eval('sText3' + sIdioma));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment