Localised Strings Xcode 4 ... Copy .strings file Error Validation failed

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


Could be as simple as a missing semi-colon at the end of the line.


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.

  1. get localized files back from translator.
  2. copy all Loclaizable.strings into your project localized folders.
  3. Open XCODE
  4. Clean all - in iOS Device/all Simulators
  5. Build
  6. Copy .strings file Error Validation failed: The data couldn't be read because it has been corrupted.
  7. Open the log navigator
  8. See which of the translations is corrupt.
  9. 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