If I copy something from textedit or web and paste it to localizable file it shows this compilation error. If I type those in localizable file it does not show any error. I am a
Your syntax seems to be fine, the only thing that I can see can "break" your file and cause this error is the quote character. Make sure to use the reqular one "
and not in any other form like ″
for example.
I Had the same issue and i resolved it by commenting or removed unused strings in my Localizable.String file :)
pl < Localizable.strings is better than plutil -lint Localizable.strings
Log will show something like this
2019-08-14 16:39:34.066 pl[21007:428513] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 427. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug. 2019-08-14 16:39:34.068 pl[21007:428513] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 427. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug. 2019-08-14 16:39:34.071 pl[21007:428513] *** Exception parsing ASCII property list: NSParseErrorException Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character / at line 1" UserInfo={NSDebugDescription=Unexpected character / at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Missing ';' on line 427" UserInfo={NSDebugDescription=Missing ';' on line 427}}
For me, it was missing semi-colons. If you use a tool to generate .strings
file, make sure there are no un-escaped quotes that may 'eat' the delimiting semi-colons.
you have to run it for each version of the localizable file. E.g
cd
into your project root cd eb.lproj
- you can replace this with
any localisation you are working with. plutil -lint Localizable.strings
When you run step 3, you will either be shown an error, telling you what is wrong with your file. Or you will be told the file is OK
Note that plutil output is bad, it seems it always says "Unexpected character at line 1" but above that output, it prints other stuff like missing semicolon on line 121, and that is the real error
I know this question was asked long ago but my scenario and solution is little bit different. Today I faced same issue but when I tried to check the issue using
plutil -lint Localizable.strings
I got OK status which means everything is fine, then I tried to find issue using
pl < Localizable.strings
But again I got file text printed with no error mentioned, then I tried a trick and it worked for me.
That's it, XCode shows me the issue with line number and the issue was I had this DéjàVerified text as key on specified line, this helps me to identify and solve the issue, I hope it will save someone's time.
Cheers!