Answer the question
In order to leave comments, you need to log in
Yandex weather api, how to get an answer in Russian?
I send a request to https://api.weather.yandex.ru/v1/forecast?lang=ru_...
the response is returned to en although lang=ru_Ru is wrong
Answer the question
In order to leave comments, you need to log in
Really strange.
We asked Yandex technical support and this is the answer we received:
Do I understand correctly that you are confused by symbols like condition: "partly-cloudy-and-light-snow"? The fact is that these are essentially codes, not text fields. Therefore, they will be displayed in English in any interface language.
To understand if lang works or not, please pay attention to the url field. In the handle of the informer, when the language changes, the url will change.
condition: "partly-cloudy-and-light-snow"
const yandexResponse = await getForecast();
const weatherTranslations = {
'partly-cloudy-and-light-snow': 'небольшой снег'
};
console.log(weatherTranslations[yandexResponse.fact.condition])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question