localizable.strings-在模拟器中工作,但不能在设备上工作 [英] localizable.strings - works in simulator but not on device

查看:63
本文介绍了localizable.strings-在模拟器中工作,但不能在设备上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的语言有问题.我只在设备上看到用NSLocalizedString定义的每个条目的ID_String.正确显示在Storyborad中设置的所有文本/图像等.如果我使用模拟器,一切都很好!

I have a problem with my language. I only see the ID_String on my device for each entry defined with NSLocalizedString. All text/images etc. set in the storyborad are shown correctly. If I use the simulator everything is fine!

因此,我想使用NSLocalizedString-也许以后再使用该选项来翻译我的应用程序.目前,我的应用程序只有德语.

So, I would like to youse NSLocalizedString - to use the option to translate my app maybe later. At this time my app is in german only.

  • 我使用storybord选项.在选项中,我将本地化设置为德国
  • 我也将字符串文件添加到我的项目中,并且也进行了德语本地化
  • 此文件中的所有行都看起来像"OK_Button" ="OK";

在我的项目文件夹中,有一个de.lproj文件夹,其中包括storybord,InfoPlist.strings和localizable.strings

In my project folder there is an de.lproj folder including the storybord, InfoPlist.strings and localizable.strings

这两个字符串被保存为UTF16.我在TextWrangler中打开这些文件,然后再次保存.

The two stings are saved as UTF16. I open these files in TextWrangler and savend them again.

几天以来我一直在搜索原因,但是我看不到我的问题. 有谁知道我的代码有什么问题,或者我的代码中缺少什么?

I search since a few days for the reason, but I dont see my problem. Have anyone an idear whats wrong, or whats missing in my code?

推荐答案

在模拟器上起作用但在设备上不起作用的一个原因是,Max OS X默认使用不区分大小写的文件系统,而iOS使用大小写敏感的文件系统.检查并确保文件名的大小写为"Localizable.strings".

One reason that something works on the simulator, but not on the device is that Max OS X uses case-insensitive file systems by default, but iOS uses a case-sensitive file system. Check to make sure that your case for the filename is "Localizable.strings".

这篇关于localizable.strings-在模拟器中工作,但不能在设备上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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