Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change description language in OpenWeatherMap api in android

In my application I want use OpenWeatherMap api for show cities weather info.
For this I want change description language to farsi .
I get this with OpenWeatherMap help and I write below URL :

http://api.openweathermap.org/data/2.5/forecast/daily?q=tehran,ir&cnt=16&units=metric&lang=Farsi-fa&appid=1487dd8a93bfd85d278d9ayty875ghyy

But show me this info :

{
    "city": {
        "id": 112931,
        "name": "Tehran",
        "coord": {
            "lon": 51.4014,
            "lat": 35.7006
        },
        "country": "IR",
        "population": 7153309
    },
    "cod": "200",
    "message": 1.31599,
    "cnt": 16,
    "list": [
        {
            "dt": 1522310400,
            "temp": {
                "day": 29.68,
                "min": 9.13,
                "max": 29.68,
                "night": 9.13,
                "eve": 19.21,
                "morn": 29.68
            },
            "pressure": 749.02,
            "humidity": 67,
            "weather": [
                {
                    "id": 801,
                    "main": "Clouds",
                    "description": "few clouds",
                    "icon": "02d"
                }
            ],
            "speed": 1.42,
            "deg": 211,
            "clouds": 20
        }
}

In OpenWeatherMap help say if add this code to URL lang=Farsi-fa change this line "description": "few clouds" language.

I add language code but not change description language!

How can I it? please help me

like image 217
RedBounce Avatar asked Mar 29 '18 11:03

RedBounce


People also ask

What is DT in OpenWeatherMap?

dt : Data receiving time (in unix, UTC format). dt is the time of data receiving in unixtime GMT (greenwich mean time).

How do I get an OpenWeatherMap key?

The API key is all you need to call any of our weather APIs. Once you sign up using your email, the API key (APPID) will be sent to you in a confirmation email. Your API keys can always be found on your account page, where you can also generate additional API keys if needed.

What type of API is OpenWeatherMap?

OpenWeather products For each point on the globe, OpenWeather provides hyperlocal minute forecast, historical data, current state, and from short-term to annual and forecasted weather data. All data is available via industry standard APIs.


1 Answers

It should be just the language code:

lang=fa

http://api.openweathermap.org/data/2.5/forecast/daily?q=tehran,ir&cnt=16&units=metric&lang=fa&appid=1487dd8a93bfd85d278d9ayty875ghyy

"description":"بارش خفیف باران"
like image 155
Levi Moreira Avatar answered Sep 27 '22 19:09

Levi Moreira