Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# XML HTML
public void  wetter()
        {
            try
            {
                string ort; // ort = Location
                ort = txtOrt.Text;
                XmlDocument googlewetter = new XmlDocument();
                googlewetter.Load(string.Format("http://www.google.com/ig/api?weather={0}", ort));
                
string stadt = googlewetter.SelectSingleNode("/xml_api_reply/weather/forecast_information/city").Attributes[0].InnerText;
                lbStadt.Text = stadt;
                
string temperatur = googlewetter.SelectSingleNode("/xml_api_reply/weather/current_conditions/temp_c").Attributes[0].InnerText;
                lbTemperatur.Text = temperatur;
                
string aktuell = googlewetter.SelectSingleNode("/xml_api_reply/weather/current_conditions/condition").Attributes[0].InnerText;
                lbAktuell.Text = aktuell;
                
string wind = googlewetter.SelectSingleNode("/xml_api_reply/weather/current_conditions/wind_condition").Attributes[0].InnerText;
                lbWind.Text = wind;
                
string luft = googlewetter.SelectSingleNode("/xml_api_reply/weather/current_conditions/humidity").Attributes[0].InnerText;
                lbLuft.Text = luft;
            }
            catch
            {
                MessageBox.Show("Error");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            wetter();
        }
 
Why is the output language always English? I want German.
Posted 21-Sep-10 4:39am
Edited 21-Sep-10 21:25pm
CPallini313.5K
v4
Comments
HimanshuJoshi at 21-Sep-10 12:33pm
   
Removed bold style from the question text
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can change the language for the request using the &hl= parameter. For example http://www.google.com/ig/api?weather=london,england&hl=de will return all text in German
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Please help me
 
i need this
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Is there noone who can help me with this problem Cry | :(( ?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

No there is nothing wrong but the visual studio output is always in english.. I put in the german wheater but i get the english weather, why?
  Permalink  
Comments
Richard MacCutchan at 23-Sep-10 15:10pm
   
If you actually read my answer above, you will see quite clearly that the answers are in German. What more information do you need?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

note work please help me bbargouthi@yahoo.com
  Permalink  
Comments
Wes Aday at 12-Sep-12 11:20am
   
How is posting this incomplete sentence an answer to this 2 year old question?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

No the problem is.. When i start debugging.. The windows form shows me the whole weather dates in english. The dates in the browser(Firefox) are in german
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

I just tried http://www.google.com/ig/api?weather=berlin,germany&hl=de&us=de[^] and received the following reply:
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0" >
<forecast_information>
<city data="Berlin, Berlin"/>
<postal_code data="berlin,germany"/>
<latitude_e6 data=""/>
<longitude_e6 data=""/>
<forecast_date data="2010-09-22"/>
<current_date_time data="2010-09-22 11:50:00 +0000"/>
<unit_system data="SI"/>
</forecast_information>
<current_conditions>
<condition data="Teils bewölkt"/>
<temp_f data="66"/>
<temp_c data="19"/>
<humidity data="Feuchtigkeit: 56 %"/>
<icon data="/ig/images/weather/partly_cloudy.gif"/>
<wind_condition data="Wind: SO mit 8 km/h"/>
</current_conditions>
<forecast_conditions>
<day_of_week data="Mi."/>
<low data="10"/>
<high data="19"/>
<icon data="/ig/images/weather/mostly_sunny.gif"/>
<condition data="Meist sonnig"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="Do."/>
<low data="12"/>
<high data="21"/>
<icon data="/ig/images/weather/sunny.gif"/>
<condition data="Klar"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="Fr."/>
<low data="13"/>
<high data="22"/>
<icon data="/ig/images/weather/chance_of_rain.gif"/>
<condition data="Vereinzelt Regen"/>
</forecast_conditions>
<forecast_conditions>
<day_of_week data="Sa."/>
<low data="10"/>
<high data="16"/>
<icon data="/ig/images/weather/chance_of_rain.gif"/>
<condition data="Vereinzelt Regen"/>
</forecast_conditions>
</weather>
</xml_api_reply>
 
Which is the part that you think is wrong?
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 371
1 Sergey Alexandrovich Kryukov 286
2 RyanDev 75
3 PhilLenoir 70
4 Pheonyx 50
0 Sergey Alexandrovich Kryukov 6,676
1 OriginalGriff 6,056
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100