I just tested the localization of Android, and I found out that you can use any arbitrary region and it will work.
Add a folder to the project with a name like values-sr-rZZ , where ZZ is a dummy area that never existed.
Then add the following code to the Application class, I got it from here and changed a bit:
public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); Resources res = this.getResources(); Configuration conf = res.getConfiguration(); boolean isLatinAlphabet = PreferenceManager.getDefaultSharedPreferences(this)...
In this code, the locale will only be changed if the user has selected the default Serbian language ( conf.locale.getLanguage().equals("sr") ), and also checked the application settings ( isLatinAlphabet ).
You can use another condition and change it as you like.
Also, such a dynamic way of changing the language may have errors with menu items on older devices, but it does not play on newer devices.
source share