How to change default locale in android?

By default, the default setting for Android is US, and the language is en. But I want to set the default location to another country. Thus, users will see their native language when they first launch the android.

I tried changing the code ( /dalvik/libcore/luni/src/main/java/java/util/Locale.java ) by changing the default value for the locale. But no effect.

Can you tell me how to set the default location?

* I want to make an image of an android, and then write it to the device, when the android is launched for the first time, I want it to be not in English, but in a different language.

+6
android default locale
source share
4 answers

Thanks for all that you answered.

I found a way to change the default language.

just change file(build/core/Makefile) .

set PRODUCT_DEFAULT_LANGUAGE and PRODUCT_DEFAULT_REGION to what you want to install.

+3
source share

I create a client assembly through build / target / product / core.mk. Samples:

  PRODUCT_PROPERTY_OVERRIDES: = \
     ro.config.notification_sound = OnTheHunt.ogg \
     ro.config.alarm_alert = Alarm_Classic.ogg \
     ro.config.ringtone = BirdLoop.ogg \
     persist.sys.language = zh \
     persist.sys.country = CN \
     persist.sys.timezone = Asia / Shanghai 

This is what I am doing to build a simplified Chinese client.
+2
source share

you can do this no matter what you want to set for the local language of the country / country / variant information.

U can use java.util.locale

and use the getISOcounty, getISOLanguage etc method .... very simple ..

learn more in detail http://developer.android.com/reference/java/util/Locale.html

it will help you ...

Does your question answer your question? any help needed, feel free to post.

Thanks Rakesh

0
source share

Have you checked this part yet?

  private Locale() { languageCode = "en"; //$NON-NLS-1$ countryCode = "US"; //$NON-NLS-1$ variantCode = ""; //$NON-NLS-1$ } 

It starts at line 212 in Locale.java. Is this the part where you set your defaults? If yes, then please write that bit so that I can check it.

EDIT: Actually, if you can post your entire Locale.java to Pastebin. http://pastebin.com/

0
source share

All Articles