热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

android多语言方法-最佳实践-androidmultilanguageapproach-bestpractices

IamtryingtodeterminethebestapproachonAndroidforsupportingmultiplelanguages.Iunderstan

I am trying to determine the best approach on Android for supporting multiple languages. I understand how resource folders work, and how they get selected when the activity loads and/or has a configuration change. I also have seen a technique of creating a new locale, assigning it as the default, and broadcasting a config change. This works. But I get the impression from this thread (https://groups.google.com/forum/?fromgroups=#!topic/android-developers/_ZGOTHwzl-w) and the answers from the google framework team this way of doing things is not recommended / supported. So my questions are:

我正在尝试确定Android上支持多种语言的最佳方法。我了解资源文件夹的工作方式,以及在活动加载和/或配置更改时如何选择它们。我还看到了一种创建新语言环境,将其指定为默认语言并广播配置更改的技术。这很有效。但是我从这个帖子(https://groups.google.com/forum/?fromgroups=#!topic/android-developers/_ZGOTHwzl-w)得到的印象和谷歌框架团队的回答这种做法是不推荐/支持。所以我的问题是:

  1. What is the recommended way to support multi languages on the fly without sending the user to the OS menus for language selection?

    在不将用户发送到操作系统菜单进行语言选择的情况下,建议何种方式支持多语言?

  2. Same question for keyboard input.

    键盘输入的问题相同。

  3. Finally, I see on my Motorola Xoom when I ask the Locale class for supported languages an impressive list. For instance, ja-JP, which I've tested and seen allows me to display Japanese chars. However there is no SIP for this language on the device. Can I download new keyboards to my platform in these cases? It just seems odd to me that the platform would support displaying many more languages than it could input.

    最后,当我向Locale类询问支持的语言时,我在我的Motorola Xoom上看到了令人印象深刻的列表。例如,我测试过的ja-JP允许我显示日语字符。但是,设备上没有此语言的SIP。在这些情况下,我可以将新键盘下载到我的平台吗?我觉得该平台支持显示的语言多于输入的语言,这似乎很奇怪。

1 个解决方案

#1


1  

Just leave the system do the work. A user with a language and a keyboard selected in settings will just expect the same conditions from your app.

离开系统就可以了。在设置中选择了语言和键盘的用户只需要从您的应用中获得相同的条件。

As far as I knew, there's no better approach as the strings.xml in the different values folders.

据我所知,没有更好的方法作为不同值文件夹中的strings.xml。


推荐阅读
author-avatar
飞翔1
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有