From 24103a98725982d1c1d026dccbbe2c98c2f3f0b8 Mon Sep 17 00:00:00 2001 From: "M. Voerman" Date: Fri, 13 Feb 2015 01:49:30 +0100 Subject: Some more translations added --- javascript/weather.js | 63 +++++++++++++++++++++++++++++++++++---------------- languages/lang_dut.js | 6 +++-- languages/lang_eng.js | 5 ++++ languages/lang_ger.js | 5 +++- 4 files changed, 57 insertions(+), 22 deletions(-) diff --git a/javascript/weather.js b/javascript/weather.js index 2ec412f..911a5ba 100644 --- a/javascript/weather.js +++ b/javascript/weather.js @@ -1,26 +1,51 @@ -function WeatherInfo_current() { +function WeatherInfo1() { + + var htmltext = "

" + Lang[100] + "

"; + htmltext += "\n\n" xmlhttp=new XMLHttpRequest(); - xmlhttp.open("GET","http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&type=accurate&mode=xml&units=metric",false); + xmlhttp.open("GET","http://api.openweathermap.org/data/2.5/weather?q=" + city + "&type=accurate&mode=xml&units=metric",false); xmlhttp.send(); + try { xmlDoc=xmlhttp.responseXML; - htmltext = "

" + " Current Weather

"; - mainmenu.innerHTML = htmltext; - + htmltext += ""; + htmltext += "
"; + htmltext += Lang[104]; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("city")[0].getAttribute("name") + ","; + htmltext += xmlDoc.getElementsByTagName("country")[0].childNodes[0].nodeValue; + htmltext += "
"; + htmltext += Lang[111]; + htmltext += " : "; + htmltext += Math.round(xmlDoc.getElementsByTagName("temperature")[0].getAttribute("value")*10)/10; + htmltext += " " + xmlDoc.getElementsByTagName("temperature")[0].getAttribute("unit"); + htmltext += "
"; + htmltext += Lang[112]; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("temperature")[0].getAttribute("min") + "/"; + htmltext += xmlDoc.getElementsByTagName("temperature")[0].getAttribute("max"); + htmltext += " " + xmlDoc.getElementsByTagName("temperature")[0].getAttribute("unit"); + htmltext += "
"; + htmltext += Lang[109]; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("humidity")[0].getAttribute("value"); + htmltext += xmlDoc.getElementsByTagName("humidity")[0].getAttribute("unit"); + htmltext += "
"; + htmltext += Lang[103]; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("speed")[0].getAttribute("value") + " m/s, "; + htmltext += xmlDoc.getElementsByTagName("direction")[0].getAttribute("name"); + htmltext += "
"; + htmltext += Lang[110]; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("clouds")[0].getAttribute("value"); + htmltext += "
"; + htmltext += " : "; + htmltext += xmlDoc.getElementsByTagName("lastupdate")[0].getAttribute("value"); + } catch(e) { + htmltext = "

\n\n\n" + Lang[67] + "\n\n\n

"; + alert(e); + } } function WeatherInfo() { diff --git a/languages/lang_dut.js b/languages/lang_dut.js index 48b51a2..4ed38b8 100644 --- a/languages/lang_dut.js +++ b/languages/lang_dut.js @@ -129,5 +129,7 @@ Lang[105] = "Breedte"; Lang[106] = "lengte"; Lang[107] = "Zon op"; Lang[108] = "Zon onder"; - - +Lang[109] = "Luchtvochtigheid"; +Lang[110] = "Wolken"; +Lang[111] = "Temperatuur"; +Lang[112] = "Min/Max"; diff --git a/languages/lang_eng.js b/languages/lang_eng.js index df44637..d49e185 100644 --- a/languages/lang_eng.js +++ b/languages/lang_eng.js @@ -129,3 +129,8 @@ Lang[105] = "latitude"; Lang[106] = "longitude"; Lang[107] = "Sunrise"; Lang[108] = "Sunset"; +Lang[109] = "Humidity"; +Lang[110] = "Clouds"; +Lang[111] = "Temperature"; +Lang[112] = "Min/Max"; + diff --git a/languages/lang_ger.js b/languages/lang_ger.js index 30833c5..c190dc1 100644 --- a/languages/lang_ger.js +++ b/languages/lang_ger.js @@ -128,5 +128,8 @@ Lang[105] = "Breite"; Lang[106] = "Laenge"; Lang[107] = "Sonnenaufgang"; Lang[108] = "Sonnenuntergang"; - +Lang[109] = "Luftfeuchtigkeit"; +Lang[110] = "Wolken"; +Lang[111] = "Temperatur"; +Lang[112] = "Min/Max"; -- cgit v1.2.3