xcode - 本地化无法读取字符串文件 (Xcode 6.3.2)

标签 xcode localization nslocalizedstring

我无法导出本地化,我只是收到“本地化无法读取字符串文件”错误。

系统日志说:

2015-06-07 01:41:48,305 Xcode[1914]: [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-7718/IDEFoundation/Localization/IDELocalizationWork.m:434
Details:  Failed to read strings file "/var/folders/vh/z7jrdtc16mv_ml4rdf3c_yf40000gn/T/Xcode3SourceStringsAdaptor-8B1BF14F-E8BF-4354-9FB6-BFF843BD6623/Localizable.strings", underlying error:
The data couldn’t be read because it isn’t in the correct format.
Object:   <IDELocalizationWork>
Method:   +readStringsWorkForContext:
Thread:   <NSThread: 0x7fa8a250a200>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

但我不知道“Localizable.strings”是什么文件。 这些步骤无效:

  • 在 Base.lproj 中找到“Localizable.strings”并将其删除。它完全是空的。
  • 删除了日志消息中指定的整个文件夹。
  • 清理并清理构建文件夹。
  • 首先运行 genstrings 以生成缺失的 .strings 文件。 genstrings 提示说我的字符串在调用 NSLocalizedString 时不是文字。呃……它们看起来都是这样的:private let ALERT_REMINDER_FIRED_TITLE = NSLocalizedString("ALERT_REMINDER_FIRED_TITLE", tableName:"ReminderHandler", comment:"my comment")

我认为 Localizable.strings 应该包含一些内容,例如 /** no localizable strings **/ 或其他内容。问题是我的项目甚至不包含该文件,它生成时完全是空的。

最佳答案

似乎未完成和注释掉的对 NSLocalizedString 的调用会干扰本地化导出。

关于xcode - 本地化无法读取字符串文件 (Xcode 6.3.2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30688768/

相关文章:

.net - 如何在正确的语言环境中将 float 插入 SQL 表

ios10 - Siri 支持无效 - 警告 iTunes Connect

ios - 无法更新配置文件

ios - 如何修复此错误 : 'Foundation._GenericObjCError error 0. '

localization - 在资源文件中命名键的最佳实践

ios - 带有动态变量的 NSLocalizedString (Swift) - 不工作

swift - NSLocalizedString 未指定语言

xcode - UICollectionView reloadItemsAtIndexPaths

ios - 将图像从 xcode Playground 快速保存到资源文件夹

ios - 如何根据语言以外的标准本地化文本