简体   繁体   English

支持印度语言的 Android 库

[英]Android Library to Support Indian Languages

I am writing an app in which I have to support all Indian languages and for that I am looking for some third party library (free or paid)我正在编写一个应用程序,我必须在其中支持所有印度语言,为此我正在寻找一些第三方库(免费或付费)

I googled many times for the same but I did not get any decent option (library)我用谷歌搜索了很多次,但我没有得到任何像样的选择(图书馆)

I just got use strings.xml for (English, Hindi) in their respective folders.我刚刚在他们各自的文件夹中使用了 strings.xml for (English, Hindi)。

But I have seen in Whatsapp there is a multilanguage option, which supports almost all major indian languages但是我在 Whatsapp 中看到有一个多语言选项,它支持几乎所有主要的印度语言

For an Example : If I do select Hindi language, so it translates complete app in Hindi language only例如:如果我选择印地语,那么它只用印地语翻译完整的应用程序

Same kind of functionality, I need in my app, like in drop down, If user do tap on any of the Indian language, my app has to converted in same one only (Like: Hindi, Telugu, Marathi, Gujarati and others)同样的功能,我需要在我的应用程序中,比如下拉菜单,如果用户点击任何印度语言,我的应用程序必须只转换为相同的语言(例如:印地语、泰卢固语、马拉地语、古吉拉特语等)

What would be the best way of doing this and getting it done?这样做并完成它的最佳方法是什么?

It depends what do you mean by "support" Android supports all Indic languages.这取决于您所说的“支持”是什么意思 Android 支持所有印度语。 But it is not localized in all them.但它并没有在所有这些中本地化。 Because of that, some of them cannot be selected from Settings.因此,无法从“设置”中选择其中一些。

But if you can provide string.xml files for all of them, and put them in the proper values-xy folder.但是,如果您可以为所有这些文件提供 string.xml 文件,并将它们放在适当的 values-xy 文件夹中。

Possible problems:可能的问题:

  1. How to select a language that the OS does not support?如何选择操作系统不支持的语言? Have your own language selection.有自己的语言选择。 Once a locale is selected, call Locale.setDefault (to change the formatters), and change the resource loading configuration ( Set Locale programmatically )选择区域设置后,调用 Locale.setDefault(更改格式化程序),并更改资源加载配置(以编程方式设置区域设置
  2. You see squares.你看到正方形。 This means missing fonts.这意味着缺少字体。 Android has fonts for all the Indic scripts. Android 有适用于所有印度文字的字体。 But older phones might miss some.但较旧的手机可能会错过一些。 And OEMs might remove some to reduce size. OEM 可能会移除一些以减小尺寸。 So you can embed the proper Noto fonts in your application and use them ( https://www.google.com/get/noto/ ).因此,您可以在应用程序中嵌入正确的 Noto 字体并使用它们 ( https://www.google.com/get/noto/ )。 Use styles, and have language specific style sheets.使用样式,并拥有特定于语言的样式表。
  3. Keyboard missing.键盘不见了。 Install one.安装一个。 Here is the Google one: https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi .这是谷歌的: https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi But there are also third party ones, for instance https://play.google.com/store/apps/details?id=org.smc.inputmethod.indic但也有第三方的,例如https://play.google.com/store/apps/details?id=org.smc.inputmethod.indic

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM