生成英文之外的本地化strings , 但程序就是死活是英文,不不是显示出本地化的string。 说明NSLocalizedString()函数压根就没去Localizable.strings文件中检索本地化的string,也就说明 Localizable.strings 文件有问题。
需要验证Localizable.strings 文件, 使用 pl 或 plutil 工具。
或者用
原来错误是漏掉了句尾的分号 (;).,
改过之后OK了。
需要验证Localizable.strings 文件, 使用 pl 或 plutil 工具。
$ pl
<
Localizable.strings
2007 - 06 - 25 20 : 54 : 30.160 pl[ 2992 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): Old - style plist parser: missing semicolon in dictionary.
2007 - 06 - 25 20 : 54 : 30.254 pl[ 2992 ] *** Exception parsing ASCII property list: NSParseErrorException XML parser error:
Unexpected character " at line 1
Old - style plist parser error:
Missing ' ; ' on line 2
2007 - 06 - 25 20 : 54 : 30.160 pl[ 2992 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): Old - style plist parser: missing semicolon in dictionary.
2007 - 06 - 25 20 : 54 : 30.254 pl[ 2992 ] *** Exception parsing ASCII property list: NSParseErrorException XML parser error:
Unexpected character " at line 1
Old - style plist parser error:
Missing ' ; ' on line 2
或者用
$ plutil Localizable.strings
2007 - 06 - 25 21 : 03 : 42.773 plutil[ 2996 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): Old - style plist parser: missing semicolon in dictionary.
2007 - 06 - 25 21 : 03 : 42.821 plutil[ 2996 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): The file name for this data might be (or it might not): Localizable.strings
Localizable.strings:
XML parser error:
Unexpected character " at line 1
Old - style plist parser error:
Missing ' ; ' on line 2
2007 - 06 - 25 21 : 03 : 42.773 plutil[ 2996 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): Old - style plist parser: missing semicolon in dictionary.
2007 - 06 - 25 21 : 03 : 42.821 plutil[ 2996 ] CFLog ( 0 ): CFPropertyListCreateFromXMLData(): The file name for this data might be (or it might not): Localizable.strings
Localizable.strings:
XML parser error:
Unexpected character " at line 1
Old - style plist parser error:
Missing ' ; ' on line 2
原来错误是漏掉了句尾的分号 (;).,
改过之后OK了。
$ plutil Localizable.strings
Localizable.strings: OK
Localizable.strings: OK