marquee-scroller icon indicating copy to clipboard operation
marquee-scroller copied to clipboard

Additional languages

Open duts33 opened this issue 5 years ago • 3 comments

How can I add additional languages ​​other than English when displaying news and weather?

duts33 avatar Oct 04 '19 09:10 duts33

Hello, for the news you must select a service in your language, for the weather I am trying to find the line that calls the API because I have read in OpenWeather that in the call you can change the language http://api.openweathermap.org/data/2.5/weather? id = 524901 & CHANGE LANGUAGE = fr & appid = {API key}, Explains it at https://openweathermap.org/current#multi but I can't find the line of code that makes the call, if someone can help it would be very kind, thanks

dj55nava avatar Oct 12 '20 19:10 dj55nava

Look at OpenWeatherMapClient.cpp

At Line 44:

String apiGetData = "GET /data/2.5/group?id=" + myCityIDs + "&units=" + units + "&cnt=1&APPID=" + myApiKey + " HTTP/1.1";

and change it like this:

String apiGetData = "GET /data/2.5/group?id=" + myCityIDs + "&units=" + units + "&lang=fr" + "&cnt=1&APPID=" + myApiKey + " HTTP/1.1";

frasier2k avatar Nov 23 '20 08:11 frasier2k

Thanks a lot!!!!! It works perfectly, so I keep the line for Spanish language in case someone needs it: void OpenWeatherMapClient::updateWeather() { WiFiClient weatherClient; String apiGetData = "GET /data/2.5/group?id=" + myCityIDs + "&units=" + units + "&lang=sp" + "&cnt=1&APPID=" + myApiKey + " HTTP/1.1";

dj55nava avatar Nov 23 '20 10:11 dj55nava