iPhone en_ *子语言本地化 [英] iPhone en_* sublanguage localization

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

问题描述

我想在我的iphone应用程序中为en_GB和其他'en'子语言本地化字符串,但是XCode和iphone拒绝让这种情况发生。我为en_GB和en_US(我尝试了连字符和下划线)创建了一个Localizable.strings的本地化用于测试目的,但它们只是无法识别。唯一有效的语言代码就是en(在XCode中显示为English)。

I want to localize strings in my iphone app for en_GB and other 'en' sub-languages, but XCode and the iphone refuse to let this happen. I have created a localization of "Localizable.strings" for en_GB and en_US (I tried both hyphens and underscores) for testing purposes, but they just aren't recognized. The only language code that works is simply "en" (displayed as "English" in XCode).

我无法相信这是不可能的,所以我的我做错了?我也希望得到典型的级联行为,如果在子语言中找不到字符串,例如en_GB然后如果可能的话应该从en中获取。帮助?

I can't believe this isn't possible, so what am I doing wrong? I'm also hoping to get the typical 'cascading' behaviour where if a string isn't found in the sub-language e.g. "en_GB" then it should be taken from "en" if possible. Help?

推荐答案

当您从iPhone偏好设置的语言列表中选择英语时,实际上意味着'en_US'语言。

When you choose 'English' from the list of languages on the iPhone preferences, that actually means the 'en_US' language.

因此,在Apple使用英语(英国)等其他子语言更新软件之前,我们将继续按区域设置区域设置,并手动加载字符串来自另一个字符串表。

So until apple update their software with additional sublanguages like "English (British)" etc. we are left with going by the locale region setting, and loading strings manually from another string table.

但是,语言和地区语言环境是分开的原因:英国的西班牙语用户可能希望根据当地习俗格式化日期/时间,但用他们的母语编程字符串。检测区域区域设置(英国)并因此显示英国字符串是不正确的。

However, the language and regional locale are separated for a reason: a Spanish user in the UK may want dates/times formatted according to the local customs, but program strings in their native tongue. It would be incorrect to detect the regional locale (UK) and therefore display UK strings.

所以基本上目前无法做到这一点。

So basically there is no way to do this currently.

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

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