Android本地化问题 [英] Android localization question

查看:20
本文介绍了Android本地化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在翻译一个应用程序.看着 this,我可以看到很多国家有几个语言代码.

I'm in the process of translating an app. Looking at this, I can see that a lot of countries have several codes for language.

我尝试为挪威语 Bokmål 创建一个名为 values-nb 的文件夹.我将手机上的语言环境更改为挪威.这适用于我的索尼爱立信 Xperia 8,但不适用于三星 Galaxy Tab.

I tried making a folder named values-nb, for Norwegian Bokmål. I changed the locale on my phones to Norway. This worked on my Sony Ericson Xperia 8, but not on the Samsung Galaxy Tab.

然后我尝试将文件夹重命名为 values-no.它现在可以在 Galaxy 选项卡上运行,但不能在 xperia 上运行.我创建了两个文件夹,并且可以正常工作.但是我必须在每个文件夹中放置相同的文件!

I then tried renaming the folder to values-no. It now works on the galaxy tab, but not on the xperia. I create both folders, and it works. But then I have to put the same file in each folder!

如果有人选择了挪威尼诺斯克语,我是否必须再创建一个文件夹,这样他们就不会默认为英语,而是获得挪威语文本?值-nn?

What if someone chose Norwegian Nynorsk, would I have to create yet another folder so that they don't default to English but get the Norwegian text? values-nn?

我想我的问题是这样的:我怎样才能让它工作?我可以制作所有这些文件夹,然后让它们引用这些值吗?请帮忙:)

I guess my question is this: How do I get this to work? Can I make all these folders and then make them reference the values-no? Please help :)

推荐答案

根据当前的搜索规则,没有办法只为特定国家/地区提供本地化并能够搜​​索所有语言.至少这是我阅读 http://developer.android.com 页面的理解/guide/topics/resources/localization.html 您需要创建 values-nn-rNO、values-nb-rNO 和 values-no-rNO 并具有重复的 strings.xml 条目.

There's no way under the current search rules to just have a localization for a specific country and be able to search all languages. At least that's my understanding from reading the pages at http://developer.android.com/guide/topics/resources/localization.html You would need to create values-nn-rNO, values-nb-rNO, and values-no-rNO and have duplicate strings.xml entries.

我还没有尝试过,但在 http://developer.android.com/guide/topics/resources/providing-resources.html#AliasResources

I haven't tried this, but look into string aliases at http://developer.android.com/guide/topics/resources/providing-resources.html#AliasResources

这篇关于Android本地化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆