找出Localizable.strings出错的具体行数

在做国际化时, 项目中需要翻译的文字比较多, 几百上千行的翻译出了如下错误是很难找的.

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

上述错误我们可以通过终端一行命令就可以解决.

1. 打开终端, cd到项目目录

2. 在终端中输入指令  plutil -lint Localizable.strings

此时会出现如下错误

2019-05-14 18:50:24.753 plutil[31541:12440037] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 259. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

这时我们就定位到错误在259行.

你可能感兴趣的:(找出Localizable.strings出错的具体行数)