Localizable.strings导致plist解析错误 [英] Localizable.strings causing plist parsing error
问题描述
我刚刚在我的Xcode项目中本地化了Localizable.strings文件,以便将我的应用程序本地化为几种不同的语言。但是,在以标准key = value格式编辑每个文件后,我收到以下解析错误,该错误未指定文件,因此很难找到它所指的内容。
I have just localized the file Localizable.strings in my Xcode project in order to localise my application to a few different languages. However, having edited each of the files in the standard "key = value" format, I receive the following parsing error, which does not specify a file making it hard to track down what it is referring to.
CFPropertyListCreateFromXMLData():旧式plist解析器:第10行的字典中缺少分号。解析将被放弃。打破_CFPropertyListMissingSemicolon进行调试。
CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 10. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
我查看了每个* .strings文件,特别是在第10行,我什么都没发现对导致问题的原因有任何兴趣或问题。请问你能告诉我哪里出错了。
I have looked through each of the *.strings files, specifically on line 10, and I found nothing of any interest or regards as to what is causing the issue. Please can you tell me where I am going wrong.
这是我项目中Localizable.strings文件的示例。所有其他文件都采用相同的格式。
Here is a sample of a Localizable.strings file in my project. All other files follow the same format.
"Enter URL" = "Voer adres in"
"Headers" = "Koppen"
"Key" = "sleutel"
"Value" = "waarde"
"Parameters" = "Parameters"
"Tap to add a new line" = "Tik om een nieuwe lijn toe te voegen"
"Perform request" = "Verzoek Uitvoeren"
"Response" = "Antwoord"
"Received Headers" = "Ontvangen Koppen"
"Error" = "Fout"
"Loading" = "Verzoek aan het versturen"
然后我使用 NSLocalizedString()
来提供翻译后的字符串。
I then use NSLocalizedString()
to provide the translated string.
推荐答案
如错误消息中所述,您在每行末尾都缺少分号。
As stated in the error message, you're missing semicolons at the end of each line.
"foo" = "bar";
格式是否正确
这篇关于Localizable.strings导致plist解析错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!