iPhone / iOS:如何判断手机在运行时使用的本地化? [英] iPhone/iOS: How Do I Tell What Localization The Phone is Using At Runtime?

查看:80
本文介绍了iPhone / iOS:如何判断手机在运行时使用的本地化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难在本地化应用。它需要本地化为波斯语(伊朗波斯语)。不仅如此,当选择fa_IR作为本地化时,它需要使用Solar Calendar。

I'm having a difficult time localizing an app. It needs to be localized into Farsi (Iranian Persian). Not only that, it needs to use the Solar Calendar, when fa_IR is selected as a localization.

操作系统有一个波斯日历。我使用它没问题,但我需要知道已经选择了fa_IR本地化。为了增加对伤害的侮辱,我不能在美国测试这个地方,因为似乎AT& T不允许它作为本地化。我必须将它发送给伊朗,这是一个皇家PItA。

The OS has a Persian calendar. It's no problem for me to use it, but I need to know that the fa_IR localization has been selected. To add insult to injury, I can't test this locale in the US, as it seems that AT&T doesn't allow it as a localization. I have to send it to Iran, which is a royal PItA.

我有一段时间在运行时找到本地化的恶魔。有许多用于访问bundle标志的东西,但我找不到任何获取运行时信息的东西。

I'm having the devil of a time finding out the localization at runtime. There's a bunch of stuff for accessing the bundle flags, but I can't find anything for getting runtime info.

我在iOS编程中非常绿色,所以我仍然需要确定哪个M到RTFM。我一直在搜索带有很多关键字的文档,但无济于事。

I'm pretty damn green at iOS programming, so I still need to determine which M to RTFM. I've been searching the docs with many keywords, to no avail.

任何人都可以帮忙解决一个看似荒谬简单的问题吗?

Can anyone help with what seems to be an absurdly easy question?

推荐答案

NSLocale 将包含您需要的区域设置信息。请注意,基础课程支持建议的设置,如24小时制和语言环境信息。

NSLocale will have the locale information you need. Do note that foundation classes support suggested settings such as 24 hour clock and locale information.

NSLog(@"%@", [[NSLocale currentLocale] localeIdentifier]);

这篇关于iPhone / iOS:如何判断手机在运行时使用的本地化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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