Closed Misiu closed 3 years ago
Thanks, will do. I will try to use standard ISO labelling for supported languages
Thanks, looking forward to that! The list of supported languages is here: https://openweathermap.org/forecast5#multi In my PR I've added the following list:
LANGUAGES = [
"af",
"al",
"ar",
"az",
"bg",
"ca",
"cz",
"da",
"de",
"el",
"en",
"es",
"eu",
"fa",
"fi",
"fr",
"gl",
"he",
"hi",
"hr",
"hu",
"id",
"it",
"ja",
"kr",
"la",
"lt",
"mk",
"nl",
"no",
"pl",
"pt",
"pt_br",
"ro",
"ru",
"se",
"sk",
"sl",
"sp",
"sr",
"sv",
"th",
"tr",
"ua",
"uk",
"vi",
"zh_cn",
"zh_tw",
"zu",
]
Ok @Misiu , it's in.
Commit eb1f943e804e1a056a49e95a35744eca80b0e1ae on branch develop
As easy as:
from pyowm.owm import OWM
owm = OWM('your-api-key')
owm.supported_languages
@csparpa that was quick 😃 can I use that const without creating an OWM instance? I need to get a list of supported languages before I create owm. Sorry for a newbie question but I'm new to Pyhon.
Yes you can, the constant is in module
https://github.com/csparpa/pyowm/blob/develop/pyowm/constants.py
Just import that with:
from pyowm.constants import LANGUAGES
On Wed, Sep 23, 2020, 19:28 Tomasz notifications@github.com wrote:
@csparpa https://github.com/csparpa that was quick 😃 can I use that const without creating an OWM instance? I need to get a list of supported languages before I create owm. Sorry for a newbie question but I'm new to Pyhon.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/csparpa/pyowm/issues/339#issuecomment-697747032, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHOXXVJFWS25HHGUUR6RF3SHIV47ANCNFSM4RWVIFQQ .
@csparpa thank you 👍 now let's wait for 3.1 to get released.
Currently, in Home Assisnatt the list of supported languages is added to Home Assistant, but as suggested by one of the contributors, ideally it should be added to your package. My recent PR is adding the whole list of languages from OWM website.
Consider adding this as a const.