9

In my application, I want to use OpenWeatherMap API to show cities weather info.
For this, I want to 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 added language code but did not change the description language!

How can I do it?

Also is there any list of supported languages for their API description language?

Hasidul Islam
  • 324
  • 3
  • 12
RedBounce
  • 213
  • 5
  • 14

1 Answers1

13

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":"بارش خفیف باران"
Levi Moreira
  • 11,917
  • 4
  • 32
  • 46