The Android system language is set to simplified Chinese (for example, Google TV) by default)
14:27:41 | category:
Default category | font size subscription
The default language for Android is English, but for Android product manufacturers in mainland China, the language is still English after leaving the factory. after entering the user's hand, can users set the language to simplified Chinese? If the customer doesn't understand English, isn't it possible to set the system language? Therefore, setting the Android system to simplified Chinese is very important for the productization of the Android system. Here is just an example. The same is true for other languages. Of course it is not for the production line to be set manually. If so, this article will lose its intention. Setting the language is simple. You can modify the system attributes to implement the default language.
There are two methods, which can be used for reference:
1. Add the following system attribute setting code to init. RC or other boot initialization files:
[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]
2. During compilation, you can specify the compilation parameters to be simplified Chinese. In this way, the system property files compiled by Traditional compilation are displayed in
During system initialization, the above attributes will be correctly initialized, for example:
Make PRODUCT-machineID-eng-zh_CN
Other related materials:
1. icu4c Introduction
Icu4c (ICU for C, http://site.icu-project.org/) is the ICU version on the C/C ++ platform, ICU (international component for Unicode) is based on "IBM Public License, an open-source project that works with open-source organizations to support international software development. Icu4c provides the powerful international development capability of the C/C ++ platform. Software developers can use icu4c to solve any international problems. According to the customs and language habits of different regions, to Format And parse numbers, currencies, times, dates, and messages, and convert, sort, search, and sort strings in case.
It provides powerful bidi algorithms and comprehensive support for bidi languages such as Arabic.
ICU was first developed by taligent, which is now merged into IBM? The Unicode research team of the company's global certification center, and the ICU was further developed by IBM and open-source organizations. The open-source organizations helped the ICU a lot.
At first, the ICU was only available on the Java platform. Later, the ICU classes on this platform were incorporated into JDK developed by Sun and continuously improved in later JDK versions. The ICU on the C ++ and C platforms is transplanted from the icu on the Java platform. The transplanted version is called icu4c, to support international applications under the C/C ++ platforms. Icu4j is slightly different from icu4c, but because icu4c is open-source and closely follows the Unicode standard, Unicode standards supported by icu4c are always the latest. At the same time, because the release of icu4j on the Java platform needs to be bound with JDK, icu4c supports Unicode standard changes much faster than icu4j.
2. Android Language Pack
The Language Pack used by Android is icu4c. The location is external/icu4c. Android supports the following languages: locale Canada
Locale constant for en_ca.
Locale canada_french
Locale constant for fr_ca.
Locale China
Locale constant for zh_cn.
Locale Chinese
Locale constant for Zh.
Locale English
Locale constant for en.
Locale France
Locale constant for fr_fr.
Locale French
Locale constant for Fr.
Locale German
Locale constant for de.
Locale Germany
Locale constant for de_de.
Locale Italian
Locale constant for it.
Locale Italy
Locale constant for it_it.
Locale Japan
Locale constant for ja_jp.
Locale Japanese
Locale constant for Ja.
Locale Korea
Locale constant for ko_kr.
Locale Korean
Locale constant for Ko.
Locale PRC
Locale constant for zh_cn.
Locale simplified_chinese
Locale constant for zh_cn.
Locale Taiwan
Locale constant for zh_tw.
Locale traditional_chinese
Locale constant for zh_tw.
Locale UK
Locale constant for en_GB.
Locale us
Locale constant for en_us.
3. Custom Language
The custom language adds the required language to the product_locales field, for example, product_locales: = en_us zh_cn. Then, the system only has two languages: English and Chinese. Then the language selection process is performed in external/icu4c/stubdata/Android. mk, as follows:
Config: =$ (word 1, \ $ (if $ (findstring AR, $ (product_locales), large )\
$ (If $ (findstring da, $ (product_locales), large )\
$ (If $ (findstring El, $ (product_locales), large )\
$ (If $ (findstring Fi, $ (product_locales), large )\
$ (If $ (findstring he, $ (product_locales), large )\
$ (If $ (findstring HR, $ (product_locales), large )\
$ (If $ (findstring Hu, $ (product_locales), large )\
$ (If $ (findstring ID, $ (product_locales), large )\
$ (If $ (findstring Ko, $ (product_locales), large )\
$ (If $ (findstring Nb, $ (product_locales), large )\
$ (If $ (findstring PT, $ (product_locales), large )\
$ (If $ (findstring Ro, $ (product_locales), large )\
$ (If $ (findstring Ru, $ (product_locales), large )\
$ (If $ (findstring SK, $ (product_locales), large )\
$ (If $ (findstring Sr, $ (product_locales), large )\
$ (If $ (findstring SV, $ (product_locales), large )\
$ (If $ (findstring th, $ (product_locales), large )\
$ (If $ (findstring TR, $ (product_locales), large )\
$ (If $ (findstring UK, $ (product_locales), large )\
$ (If $ (findstring ZH, $ (product_locales), large )\
$ (If $ (findstring Ja, $ (product_locales), US-Japan )\
$ (If $ (findstring it, $ (product_locales), US-Euro )\
$ (If $ (findstring PL, $ (product_locales), US-Euro )\
$ (If $ (findstring CS, $ (product_locales), default )\
$ (If $ (findstring de, $ (product_locales), default )\
$ (If $ (findstring FR, $ (product_locales), default )\
$ (If $ (findstring NL, $ (product_locales), default )\
US)
4. default language
In build/CORE/makefile, select the first language from product_locales as the default language, as shown below:
Define default-locale $ (SUBST _, $ (firstword $(1 )))
Endef
# Selects the first locale in the list given as the argument
# And returns the language (or the region)
Define default-locale-language $ (Word 2, 2, $ (call default-locale, $(1 )))
Endef
Define default-locale-region $ (word 3, 3, $ (call default-locale, $(1 )))
Endef... product_default_language = "$ (call default-locale-language, $ (product_locales ))"\
Product_default_region = "$ (call default-locale-region, $ (product_locales ))"
Then, use the build/tool/buildinfo. Sh file to write the following section to the file build. Prop, as shown below:
Echo "Ro. Product. locale. Language = $ product_default_language"
Echo "Ro. Product. locale. region = $ product_default_region ".
Therefore, you can use either of the following methods to change the default language:
4.1 In the product_locales field, place the language to be selected first, for example, product_locales: = en_us zh_cn. The default language is English;
4.2 specify the language in persist. SYS. Language and persist. SYS. Country, as follows: product_property_overrides: = \
Persist. SYS. Language = ZH \
Persist. SYS. Country = cn build. Prop file processing is in system/CORE/init/property_service.c.