我如何本地化UIImagePickerController [英] How do I localize UIImagePickerController

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

问题描述

我编写了一个使用自定义本地化的iOS应用程序(出于各种原因)。它取消定义NSLocalizedString并替换为同名的内联函数,该函数从服务器下载的NSDictionary中提取它的值。

I've written an iOS app which uses custom localization (for various reasons). It undefines NSLocalizedString and replaces with an inline function of the same name which pulls it's values from an NSDictionary which is downloaded from a server.

我的问题是这个......一切工作正常,但标准的UIKit视图(即UIImagePickerController)没有被国际化,我认为这是在设备语言改变时会自动发生的事情吗?

My problem is this... Everything works fine, but standard UIKit views (namely UIImagePickerController) aren't being internationalized, which I believe is something that should happen automatically when the device language is changed?

例如,我的完整应用程序显示它的日语版本,但即使设备语言设置为日语标准控件(搜索栏上的UIImagePickerController和取消按钮未显示!)

For example, my full app is displaying it's japanese counterpart, but even though the device language is set to japanese the standard controls (UIImagePickerController and cancel button on search bars aren't showing!)

非常感谢任何帮助:D

Any help would be much appreciated :D

编辑

我有尝试删除我对NSLocalizedString的重新定义,我仍然有同样的问题,所以虽然建议我不要重新定义标准的api功能很棒,但它并没有真正帮助我解决我的enco问题没有。

I have tried removing my redefinition of NSLocalizedString and I still have the same problem, so while advising me against redefining standard api functionality is great, it doesn't really help me with the issue I've encountered.

推荐答案

您是否添加了您希望支持的语言到您的应用程序的定义?在XCode 4中,可以在项目信息页面中找到它(见下文)。

Did you add the languages you wish to support to your app's definition? In XCode 4 this can be found in your Project Info page (see below).

如果设备语言不在,则UIKit视图不会以设备语言显示应用程序支持的语言列表。这是一件好事,否则在使用标准本地化框架的应用程序中,用户可能会看到不同语言的混合(UIKit视图将使用设备语言,而所有其他内容,在设备语言中不可用,将在应用程序的基本语言)。

UIKit views aren't shown in the device language if the device language isn't in the app's supported languages list. This is a good thing, otherwise in an app that uses the standard localization framework the user might see a mix of different languages (UIKit views would be in the device language and all the other content, being unavailable in the device language, would be in the app's base language).

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

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