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

How can I specify asset file with country code (like en-US, en-UK)? #11

Closed
trietbui85 opened this issue Oct 22, 2019 · 2 comments
Closed
Labels
question Further information is requested

Comments

@trietbui85
Copy link

I notice some localization library for Flutter supports naming like languageCode-countryCode (for example en-US, en-UK) but this library doesn't. Can you add support for it?

@bratan
Copy link
Member

bratan commented Oct 22, 2019

The library supports it, but you need to specify the format as languageCode_countryCode (underline instead of dash)

For example: en_US, en_GB, es_ES

It will also automatically fallback to languageCode for the filename.

So for example if you define the supported locales this way:

supportedLocales: ['en_US', 'en_GB', 'es_ES'])

It will search for the filenames en_US.json, en_GB.json ... and if not found, it will fallback to en.json

I will have to update the documentation as there are some more features not yet documented properly.

@trietbui85
Copy link
Author

@bratan Thanks for your answer. It's great to know that feature is already supported yet.

@bratan bratan added the question Further information is requested label Oct 22, 2019
@bratan bratan closed this as completed Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants