使用与OS /设备中设置的语言不同的语言的iPhone应用程序? [英] iPhone app using different language than the one set in OS / device?

查看:120
本文介绍了使用与OS /设备中设置的语言不同的语言的iPhone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以让我的应用程序以与操作系统中设置的语言不同的语言运行?我想在我的应用程序的设置菜单中进行语言切换,用户可以在选择德语作为应用程序,而他的系统是用英语运行。



从我已经读过的内容看,如果没有我自己的本地化机制,它似乎是不可能的...... / p>

你怎么看?



Cheerz,pawi

解决方案

您需要实现自定义资源加载机制来实现这一目标。例如,您将无法再使用NSLocalizedString宏或[NSBundle pathForResource:]。您将始终必须指定包含本地化的路径(如de.lproj / MyStrings.strings而不仅仅是MyStrings.strings)。除非绝对必要,否则我建议不要这样做。


Is it possible to have my app running in a different language than the one that is set in the OS? I want to have a language switch in my app’s setting menu, where the user can e.g. select german for the app, while his system is running in english.

From what I’ve already read, it seems it’s not possible without having my own localization mechanism…

What do you think?

Cheerz, pawi

解决方案

You need to implement your custom resource loading mechanism to achieve that. For example you will no longer be able to use NSLocalizedString macro or [NSBundle pathForResource:]. You will always have to specify paths including the localization (as in de.lproj/MyStrings.strings instead of just MyStrings.strings). I would suggest against doing this unless absolutely necessary.

这篇关于使用与OS /设备中设置的语言不同的语言的iPhone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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