Skip to content

How to retrieve a list of available locales? #160

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

Closed
HeRo002 opened this issue Jan 27, 2021 · 3 comments
Closed

How to retrieve a list of available locales? #160

HeRo002 opened this issue Jan 27, 2021 · 3 comments

Comments

@HeRo002
Copy link

HeRo002 commented Jan 27, 2021

Is there a way to retrieve a list of available locales using Fluent.runtime (or maybe Babel)?
Or would I have to retrieve a list of folders directly from the operating system?
How do I do that? :-)
Thank you.

@zbraniecki
Copy link
Collaborator

"available" is subjective to your app, we don't control how and where you store locales and or how you load resources.

For the future, questions like this are better addressed on our discourse : https://discourse.mozilla.org/c/fluent/262

@Pike
Copy link
Contributor

Pike commented Jan 27, 2021

To clarify some details that are specific to the python impl, https://www.projectfluent.org/python-fluent/fluent.runtime/stable/usage.html documents how the python impl actually suggests to structure your localization resources.

There's no utility though to determine available locales.

Also, that list doesn't actually show up, the list of locales you'd want to pass in to the FluentLocalization class is the list of requested locales, it doesn't matter in practice on whether those exist or not.

@HeRo002
Copy link
Author

HeRo002 commented Jan 27, 2021

Thank you for your answers!

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

3 participants