Difference between revisions of "Widget:Language"

From UnderWiki
Jump to navigation Jump to search
Line 11: Line 11:
 
<script>
 
<script>
 
   var a_en = document.getElementById("title_en");
 
   var a_en = document.getElementById("title_en");
   var a_es = document.getElementById("title_en");
+
   var a_es = document.getElementById("title_es");
   var a_fr = document.getElementById("title_en");
+
   var a_fr = document.getElementById("title_fr");
   var a_it = document.getElementById("title_en");
+
   var a_it = document.getElementById("title_it");
   var a_de = document.getElementById("title_en");
+
   var a_de = document.getElementById("title_de");
   var a_ch = document.getElementById("title_en");
+
   var a_ch = document.getElementById("title_ch");
   var a_ru = document.getElementById("title_en");
+
   var a_ru = document.getElementById("title_ru");
   var a_jp = document.getElementById("title_en");
+
   var a_jp = document.getElementById("title_jp");
   var b_en = document.getElementById("title_en");
+
   var b_en = document.getElementById("text_en");
   var b_es = document.getElementById("title_en");
+
   var b_es = document.getElementById("text_es");
   var b_fr = document.getElementById("title_en");
+
   var b_fr = document.getElementById("text_fr");
   var b_it = document.getElementById("title_en");
+
   var b_it = document.getElementById("text_it");
   var b_de = document.getElementById("title_en");
+
   var b_de = document.getElementById("text_de");
   var b_ch = document.getElementById("title_en");
+
   var b_ch = document.getElementById("text_ch");
   var b_ru = document.getElementById("title_en");
+
   var b_ru = document.getElementById("text_ru");
   var b_jp = document.getElementById("title_en");
+
   var b_jp = document.getElementById("text_jp");
  
function changeLanguage() {
+
function changeLanguage(l) {
  var l = document.getElementById("oLang").value;
 
 
   switch(l)
 
   switch(l)
 
   {
 
   {
Line 178: Line 177:
 
</script>
 
</script>
  
<select id="oLang" onchange="changeLanguage()">
+
<select id="oLang" onchange="changeLanguage(this)">
 
<option value="en" selected>EN - English</option>
 
<option value="en" selected>EN - English</option>
 
<option value="es">ES - Español</option>
 
<option value="es">ES - Español</option>

Revision as of 09:27, 17 March 2019

This widget inserts a language picker.