Localizable.strings causing plist parsing error
Asked Answered
M

5

21

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(): Old-style plist parser: missing semicolon in dictionary on line 10. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

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.

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"

I then use NSLocalizedString() to provide the translated string.

Metacarpal answered 26/3, 2013 at 21:46 Comment(0)
Y
47

As stated in the error message, you're missing semicolons at the end of each line.

"foo" = "bar";

Is the correct format

Yorgen answered 26/3, 2013 at 21:47 Comment(1)
+ Make sure all quotation marks are escaped, "foo" = "\"quotation\" bar"; ("plutil" exited with code 1)Mohur
G
3
"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";

this is the correct formula

Gainly answered 5/2, 2014 at 21:24 Comment(0)
M
1

This message can also be come due to use of :(colon) instead of ;(semicolon) at line end. Please be sure there is semicolon(;) at each end of line and also there is no colon(:) also.

Monitorial answered 23/12, 2013 at 19:47 Comment(0)
D
0

Swift 4

make sure the one for all Apps file for Localizable.strings don't make more than one page just one

local.string English "hi" = "hi";

local.string Arabic "hi" = "هاي";

using

and put this extension in your app

extension String {
    var localizedLized: String {
        return NSLocalizedString(self, comment: "")
    }
}
Drumstick answered 2/12, 2019 at 17:22 Comment(0)
E
0

In my case the error was caused by a missing quotation mark.

"CFBundleDisplayName" = myTestApp";
Eleanoraeleanore answered 29/9, 2021 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.