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

查看:20
本文介绍了如何本地化 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 功能很好,但它并不能真正帮助我解决我遇到的问题.

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天全站免登陆