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

Language list restriction #1

Open
thinkpozzitive opened this issue Oct 25, 2016 · 5 comments
Open

Language list restriction #1

thinkpozzitive opened this issue Oct 25, 2016 · 5 comments

Comments

@thinkpozzitive
Copy link

How can I restrict the list of available languages to only the languages for which I have values-* xml files?

Currently the list contains all languages, but I'd like to give my users the option of switching the app language to only a list of predefined languages that I have translations for.

Thank you.

@ocram
Copy link
Contributor

ocram commented Jan 21, 2017

This is not possible yet, unfortunately, but definitely a good idea. We should implement that. Thanks!

@farshid1
Copy link

Honestly, I don't see much use of this library without this feature. Not all applications have the resources for all languages

@ocram
Copy link
Contributor

ocram commented Jan 28, 2017

@farshid1 and @thinkpozzitive I agree that having the ability to restrict the list of languages may be really helpful. But if we added that, it could only ever be a manual restriction.

The reason for this is that there's no way to get the list of your app's languages automatically. You can get a list of available languages or even resource folders, but that usually includes the operating system's languages, which renders the information useless for our purposes.

There's one workaround, of course: You could select a single string from your app's resources and load it with every single language, one after another, changing the app's language between each pair of queries. After comparing the results with the string from the default language, you would know which languages have a string that differs and thus are actively supported in your app. But this solution is, obviously, ugly and slow.

Adding a manual restriction, where you define the available languages in code, may be possible, on the other hand. But perhaps you don't like this approach's downside of having to define the list of languages in code again. What do you think?

@vernazza
Copy link

vernazza commented Feb 9, 2017

I agree with @farshid1 and @thinkpozzitive , this feature is absolutrly needed.
Defining the list by hand isn't a big deal at all.

@sagilo
Copy link

sagilo commented Apr 21, 2017

Voting for this as well, my app is translated to about 12 languages, so I have no use in any other not translated language.

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

5 participants