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"