天天看点

Localizable.strings:0: error: read failed: The data couldn’t be read because it isn’t in the correct

在给app作本地华的时候提示很莫名的错误

zh-Hans.lproj/Localizable.strings:0: error: read failed: The data couldn’t be read because it isn’t in the correct format.

经查是因为在Localizable.strings的非符串中用到了全角的字符(一般是出错最多的是等号=)空格,这一点在翻译中文时特别容易出错,因为经常要在全角和半角的字符进行切换,更糟糕的是xcode居然不能定位到具体出错错的位置,我在进行中Localizable.strings的翻译过程用得最笨的一方法是,翻译几行,再编译一下是否出错,不要等整个文件都翻译完了之后再进行编译,否刚你将会花更多的时候来查找错误的地方了。