Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list of supported languages #339

Closed
Misiu opened this issue Sep 23, 2020 · 6 comments
Closed

Add list of supported languages #339

Misiu opened this issue Sep 23, 2020 · 6 comments

Comments

@Misiu
Copy link

Misiu commented Sep 23, 2020

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.

@csparpa
Copy link
Owner

csparpa commented Sep 23, 2020

Thanks, will do.
I will try to use standard ISO labelling for supported languages

@csparpa csparpa added this to the 3.1 milestone Sep 23, 2020
@Misiu
Copy link
Author

Misiu commented Sep 23, 2020

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",
]

@csparpa
Copy link
Owner

csparpa commented Sep 23, 2020

Ok @Misiu , it's in.

Commit eb1f943 on branch develop

As easy as:

from pyowm.owm import OWM
owm = OWM('your-api-key')
owm.supported_languages

@csparpa csparpa closed this as completed Sep 23, 2020
@Misiu
Copy link
Author

Misiu commented Sep 23, 2020

@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.

@csparpa
Copy link
Owner

csparpa commented Sep 23, 2020 via email

@Misiu
Copy link
Author

Misiu commented Sep 24, 2020

@csparpa thank you 👍
now let's wait for 3.1 to get released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants