Reputation: 3104
I'm developing application that can be useful only in my country(Ukraine). In Ukraine people primary speak Ukrainian or Russian. And I need to create something like radioButton to switch between languages.
Until now I only found tutorials that were using "locale", but it will not suit my needs, because location is same (Ukraine) but languages are different.
So let's imagine that I have saved in database parameter that show language
I created 2 types of res/values (values-ua & values-rus). I am starting activity what code I need to use to show which resources I need?
Upvotes: 6
Views: 1516
Reputation: 12857
uk Ukrainian ukrainien Ukrainisch
ru Russian russe Russisch
http://www.loc.gov/standards/iso639-2/php/code_list.php
Upvotes: 1
Reputation: 9182
I think your problem is that you used the wrong country codes. Try values-ru and values-uk. [source]
Not fully sure what you intend to do, but I would not provide any radio button. Instead, I would rely on android's built in support for localization. In other words, suppose user A has a device with the Ukranian language enabled by the os, the app will automatically use the strings provided in the strings.xml file which resides in the values-uk folder. Same goes for russian. Check this answer- it might help.
Upvotes: 5