Reputation: 5303
I'm trying to include the internationalization of my application, and only for testing purposes I added a simple line in the file Localizable.string.
This is my whole file:
"Test locale" = "Test locale"
And when I try run my application I get this error:
Localizable.strings:0: error: validation failed: The data couldn’t be read because it has been corrupted.
I've tried changing the "Text Encoding" to UTF-16 but nothing resolved.
Upvotes: 29
Views: 15430
Reputation: 1764
There can be multiple reasons for this:
<<<<<<< HEAD
, =======
and >>>>>>>
.
Please note that plutil -lint Localizable.strings
returned OK
for point-2 & 7!
Upvotes: 0
Reputation: 16246
In my case, it was like this:
/* Comment for Very Long Sentence */
"Very Long Sentence Very Long Sentence Very Long Sentence Very Long Sentence " =;
"Very Long Sentence Very Long Sentence Very Long Sentence Very Long Sentence ";
(Notice the ' = ; ' instead of ' = ' at the end of the first line)
Upvotes: 4
Reputation: 3506
If this is your whole file, add a semicolon at the end. Change it to:
"Test locale" = "Test locale";
Upvotes: 58
Reputation: 1229
I've made a little script to check whole folders .strings files using plutil.
https://github.com/CarlesEstevadeordal/check_strings
Upvotes: 0
Reputation: 1494
To get more detailed informations you can use the Property List utility from the command line:
plutil -lint <your_strings_file>.strings
the -lint
switch is for checking the syntax. If you have an error you'll get line number and more informations, and in general better directions on how to fix the issue.
Upvotes: 45
Reputation: 891
You can verify your Localizable.strings file with this script:
https://github.com/dcordero/Rubustrings
Upvotes: 7
Reputation: 16664
In my case it was brackets inside string — I needed to add slash before \".
Upvotes: 1