如何本地化 UIImagePickerController

编程入门 行业动态 更新时间:2024-10-28 18:24:46
本文介绍了如何本地化 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

本文发布于:2023-07-24 13:10:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1203649.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UIImagePickerController

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!