I have a free open source app that already supports multiple languages. To test the languages I switch the phone’s setting | language and everything works just fine.
Once in a while I get requests from people that want to translate the app to a language that is not listed on my own device (CM 7.1 or US Nexus 7). For example, the last one was for Albanian. I presume that the language code is ‘sq’ so I can create res/values-sq with the translation they provide but how can I test it on my own phone?
Is there a way to force my app to use a specific language code (e.g. ‘sq’), even if it is not listed in my phone’s settings?
To clarify, I don’t want to reinvent language switching, just to influence the resource selector to use res/values-sq.
If it matters, the app uses android:minSdkVersion=”8″.
Your phone vendor chose not to include the Albanian locale, so unfortunately you won’t be able to choose it. This is usually vendor specific and depends greatly on your location. For example, Samsung will not include the Albanian locale in an Android build used for phones to be distributed in the US.
As for forcing your app directly to choose one of your locale’s, it is not doable afaik. The best you could do (in case you want to test your resources) would be to recreate the project and remove all the other resources and leave the Albanian-specific ones. The system will “be forced” use them.