如何在xcode 5和ios 7中设置默认语言环境? [英] How do I set the default locale in xcode 5 and ios 7?

查看:82
本文介绍了如何在xcode 5和ios 7中设置默认语言环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个已经被问到的问题,但没有一个答案对我有帮助。

I know this is an already asked question, but no one of the answers helped me.

我正在编写一个本地化为意大利语和英语的iOS应用程序。

I'm writing an iOS app localized in italian and english.

我已经为文本做了两个故事板和两个Localizable.strings文件。

I've already done two storyboards and two Localizable.strings file for the texts.

现在,如果我在电话上设置英语语言,应用程序选择英语文件,如果我在手机上设置意大利语语言应用程序选择意大利语文件。

Now, if I set the english language on the phone, the app picks the english files, if I set the italian language on the phone the app picks the italian files.

但如果我设置法语(或西班牙语,或德语),应用程序选择意大利文件,这是错误的,我怎么能将英语设置为默认语言?

But if I set french language(or spanish, or german), the app picks the italian files, which is wrong, how can I set english as the default language?

推荐答案

iOS设备会跟踪您将语言环境设置为的语言。如果应用程序中不支持当前选定的区域设置,则设备将使用应用程序支持的上次用户选择的语言。

An iOS device keeps track of which languages you have set the locale to. If the currently selected locale is unsupported in an app, then the device will use the last user-selected language you used that is supported by the application.

例如,想象你已经将设备改为英语,然后是意大利语,然后是西班牙语。该应用程序将首先尝试提供西班牙语本地化。如果没有,它会尝试意大利语。如果 不可用,那么它最终将使用英语。

So for example, imagine you had changed your device to English, then Italian, then Spanish. The app would first try and provide a Spanish localization. If one wasn't available, it would attempt Italian. If that wasn't available, then it would finally use English.

如果您在设备的设置中查看语言列表,那么''我们会看到它们是按上次使用排序的。我不知道有任何方法可以改变这个(看似有意的)功能。

If you view the list of languages in the device's Settings, you'll see that they're ordered by 'last used'. I'm not aware of any way to alter this (seemingly intentional) feature.

这篇关于如何在xcode 5和ios 7中设置默认语言环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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