Adding/Removing the language entries in the “Settings” -> “Select Locale” from Android phone

狂风中的少年 提交于 2019-12-02 19:06:24

on HTC phones you must also modify /system/customize/CID/default.xml ... That is the file they use to specify locales on their stock roms. If the rom is a WWE, supposedly editing CID is all one need do, but this doesn't always hold true.

I think that a normal application should not add locations to the phone. There are special packages like MoreLocale 2 for that purpose. If you'd add a locale, you'd be responsible not only to provide localisation for your own application but for the whole system!

you have to create "values" folder in "res" folder of android's framework-res package. Name of that new folder have to contain country code of your need ie. values-pl-rPL (the rPL part is required) for polish language (for british english: en-rGB, etc), that should be enough - if not - create strings.xml file in that folder, and add there empty "resources" node.

To create or add multiple languages to your application, first you have to define all you string values in the string.xml in the values folder rather than hard coding them in you program. Then you also have to have different Value folders for different languages, e.g. Value-es for Spanish and Value-fr for french. This should do the job. I dont think the application can change locale by default.

I think you have to edit the

PRODUCT_LOCALES

Present in build/target/product/languages_full.mk , and add and remove the strings assigned to this.

You can define your custom string like zz_zz and add folder values_zz_zz in each of your res folders.

Have not tried this but this might work.

Note: PRODUCT_LOCALES might be overridden somewhere else depending on your build system

For removing languages, if we remove the locale string from PRODUCT_LOCALES, it will work.

I am also looking for a way to add new languages, but just adding to this doesn't help. I think we need to update some low level files or libraries in order to add new languages.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!