【问题标题】:How to change description language in OpenWeatherMap api in android如何在 android 的 OpenWeatherMap api 中更改描述语言
【发布时间】:2018-09-08 08:37:47
【问题描述】:

在我的应用程序中,我想使用 OpenWeatherMap api 来显示城市 weather 信息。
为此,我想将 description language 更改为 farsi
我通过 OpenWeatherMap 帮助得到了这个,我写在下面 URL

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

OpenWeatherMap 中帮助说明是否将此代码添加到 URL lang=Farsi-fa 更改此行 "description": "few clouds" language

我添加了语言代码,但没有更改描述语言!

我该怎么办?请帮帮我

【问题讨论】:

    标签: java android retrofit2 openweathermap


    【解决方案1】:

    应该只是语言代码:

    lang=fa
    
    http://api.openweathermap.org/data/2.5/forecast/daily?q=tehran,ir&cnt=16&units=metric&lang=fa&appid=1487dd8a93bfd85d278d9ayty875ghyy
    
    "description":"بارش خفیف باران"
    

    【讨论】:

    • 谢谢我的朋友,你的回答对我有帮助
    猜你喜欢
    • 2016-05-08
    • 2011-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多