Localizable.strings在iOS中不起作用 [英] Localizable.strings not working in iOS

查看:341
本文介绍了Localizable.strings在iOS中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个令人不寒而栗的问题.

I'm having this really mind breaking problem.

我先用XCode创建了Localizable.strings文件,然后用其中的2种语言创建了文件.

I created a Localizable.strings file in XCode and then 2 languages in it.

我用语言翻译填充了这些文件,先进行构建/清理,然后重新构建,但是本地化字符串无法显示在我的项目中.如果我尝试类似的事情:

I filled up these files with the language translations, did a build/clean and then a fresh build, but there is no way the Localization strings show up in my project. If I try something like:

self.title = NSLocalizedString(@"HEAD", nil);

在设备模拟器中仅显示"HEAD"而不是翻译.

only "HEAD" instead of the translation shows up in the device simulator.

这是我的项目层次结构:

This is my project hierarchy:

这是英语本地化文件的内容:

And this are the content of the English localization file:

有什么想法吗?

推荐答案

我自己找到了答案.

除了清理和重新构建项目以及我上面描述的所有内容之外. 您还必须在iPhone模拟器中删除该应用,然后重新构建!之后,它可以正常运行.

Besides cleaning and building the project again and all that I described above. You must also delete the app in the iPhone simulator and then build it again! After that it works perfectly.

谈论使其成为简单的Apple ...

Talk about making it simple Apple...

这篇关于Localizable.strings在iOS中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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