gpt4 book ai didi

java - 如何在android中的OpenWeatherMap api中更改描述语言

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:56:11 25 4
gpt4 key购买 nike

在我的应用程序中,我想使用 OpenWeatherMap API 来显示城市的天气信息。
为此,我想将描述 语言更改为波斯语
我在 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": "几朵云” 语言

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

我该怎么做?

他们的 API 描述语言是否有支持的语言列表?

最佳答案

应该只是语言代码:

lang=fa

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

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

关于java - 如何在android中的OpenWeatherMap api中更改描述语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49555188/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com