Localised Strings Xcode 4 ... Copy .strings file Error Validation failed
Solution 1:
Could be as simple as a missing semi-colon at the end of the line.
Solution 2:
I had same the issue finding the errors within the localization file...
Just use the tool plutil in the terminal to convert the file and you will get a proper error message with the line number.
plutil -lint Localizable.strings
Response
plutil[74058:707] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 422. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug. Localizable.strings: Unexpected character " at line 1
Solution 3:
yes just trawled through 500 translations
note the KISS in the second string is in Double quotes which are INSIDE another DOUBLE QUOTES ERROR
"Before using KISS Remixer, you must agree to the terms and conditions of use." = "Vor der Nutzung des Remixers "KISS" müssen Sie die Allgemeinen Geschäftsbedingungen akzeptieren.";
This is OK
"Before using KISS Remixer, you must agree to the terms and conditions of use." = "Vor der Nutzung des Remixers KISS müssen Sie die Allgemeinen Geschäftsbedingungen akzeptieren.";
as is this (replace with single quotes INSIDE THE DOUBLE)
"Before using KISS Remixer, you must agree to the terms and conditions of use." = "Vor der Nutzung des Remixers 'KISS' müssen Sie die Allgemeinen Geschäftsbedingungen akzeptieren.";
TIP USE a BINARY SEARCH to find the offending line.
- get localized files back from translator.
- copy all Loclaizable.strings into your project localized folders.
- Open XCODE
- Clean all - in iOS Device/all Simulators
- Build
- Copy .strings file Error Validation failed: The data couldn't be read because it has been corrupted.
- Open the log navigator
- See which of the translations is corrupt.
- I opened the Localizable.strings in TextWrangler At bottom in tool bar Translator had sent back UTF-16 file as
UTF-16 Little Endian Changed it back to just 'UTF-16' 10. Cleaned build/Build SAME ERROR
Somewhere in the file is
Missing semicolon?
/* popup message */
"Save mix" = "Enregistrer le mixage";
/* popup message */
"Save mix" = "Enregistrer le mixage"
"Extra "double quotes" inside double quotes"
WRONG
/* popup message */
"Save mix" = "Enregistrer le "mix" age"
RIGHT
/* popup message */
"Save mix" = "Enregistrer le mixage"
ALSO RIGHT
/* popup message */
"Save mix" = "Enregistrer le 'mix'age"
- remember there may be more than one error in a file I found "KISS" in double-double quotes in two places