Modify the android default system language to "medium" and "Time Zone"

Source: Internet
Author: User

The original Android code. The default language of the system is English. Generally, you need to change it to the default Chinese. There are many ways to modify it:

1. Modify the product_locales field,

The language to be selected is placed first, for example, product_locales: = en_us zh_cn. The default language is English. copy it from MK and paste it to device/{hardware platform}/{product }. MK, put zh_cn in the first place. Or directly paste it to build/target/product/CORE. mk. All branches inherit this setting.

2. Modify device/{hardware platform}/{product}/system. Prop or default. Prop and add:

[Persist. SYS. Language]: [zh]

[Persist. SYS. Country]: [CN]

[Persist. SYS. localevar]: []

[Persist. SYS. timezone]: [Asia/Shanghai]

[Ro. Product. locale. Language]: [zh]

[Ro. Product. locale. region]: [CN]

3. Modify init. RC and add:

Setprop persist. SYS. Language ZH

Setprop persist. SYS. Country CN

Setprop persist. SYS. localevar

Setprop persist. SYS. timezone Asia/Shanghai

Setprop Ro. Product. locale. Language ZH

Setprop Ro. Product. locale. region CN

This method has a problem because it is executed every time it is started, so the language is the default language after each boot.

4. Modify device/{hardware platform}/{product}/device. mk and add:

Product_property_overrides + = \

Persist. SYS. Language = ZH \

Persist. SYS. Country = cn \

  Persist. SYS. localevar = "" \

Persist. SYS. timezone = Asia/Shanghai \

Ro. Product. locale. Language = ZH \

Ro. Product. locale. region = Cn

I use 4th types. Note that the quotation marks above cannot be removed; otherwise, the two lines in build. Prop will become one line:

  Persist. SYS. localevar =Persist. SYS. timezone = Asia/Shanghai

This will cause the value of persist. SYS. timezone to fail to be obtained. The time zone is still incorrect.

5. Modify build/tools/buildinfo. sh:

Echo "Persist. SYS. Language = ZH"

Echo "Persist. SYS. Country = cn"

Echo "Persist. SYS. localevar ="

Echo "Persist. SYS. timezone = Asia/Shanghai"

Echo "Ro. Product. locale. Language = ZH"

Echo "Ro. Product. locale. region = cn"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.