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

I believe the underlying language data is incorrect #598

Closed
dmckinno opened this issue Jul 26, 2018 · 1 comment
Closed

I believe the underlying language data is incorrect #598

dmckinno opened this issue Jul 26, 2018 · 1 comment

Comments

@dmckinno
Copy link

dmckinno commented Jul 26, 2018

I wanted to build a dictionary mapping country names to languages spoken there. Babel's database is right for the majority of countries, but assigned English to a number of European countries (Belgium for instance) for which English is not the official language.

I used the code below.

country = []
language = []
for locale in list_of_locales:
    l = Locale.parse(locale)
    country.append(l.territory_name)
    language.append(l.language_name)
@akx
Copy link
Member

akx commented Jul 26, 2018

Hi!

There may be locale combinations that don't correspond to official languages, so that's not the correct way to go about this.

Instead, please use the babel.languages.get_official_languages() API.

@akx akx closed this as completed Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants