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

后端 未结 6 1485
礼貌的吻别
礼貌的吻别 2021-02-01 03:20

My question:

How can I add or remove the language entries in the \"Settings\" -> \"Language & keyboard settings\" -> \"Select Locale\"(or \"Select Language\") in t

相关标签:
6条回答
  • 2021-02-01 03:56

    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.

    0 讨论(0)
  • 2021-02-01 04:01

    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.

    0 讨论(0)
  • 2021-02-01 04:02

    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.

    0 讨论(0)
  • 2021-02-01 04:03

    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!

    0 讨论(0)
  • 2021-02-01 04:05

    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

    0 讨论(0)
  • 2021-02-01 04:09

    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.

    0 讨论(0)
提交回复
热议问题