如何在Android中更改OpenWeatherMap API的描述语言

9
在我的应用中,我想使用OpenWeatherMap API来显示城市的天气信息。为此,我想将描述语言更改为波斯语。我通过OpenWeatherMap帮助获得了这个URL:(请保留HTML标记)
http://api.openweathermap.org/data/2.5/forecast/daily?q=tehran,ir&cnt=16&units=metric&lang=Farsi-fa&appid=1487dd8a93bfd85d278d9ayty875ghyy

但是给我展示这些信息:

{
    "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
        }
}

在帮助文档中提到,如果在URL中添加代码“lang=Farsi-fa”,可以更改该行的语言:“description”:“few clouds”。我添加了语言代码,但是没有改变“description”的语言!请问应该如何操作?此外,他们的API说明语言支持哪些语言?
1个回答

13

应该只是语言代码:

lang=fa

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

"description":"بارش خفیف باران"

谢谢我的朋友,你的回答对我很有帮助 <3 - RedBounce

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接