Localizable.strings error: “The data couldn’t be read because it isn’t in the correct format”
Posted: | Author: Jörn | Filed under: Objective-C, Swift, Xcode | 6 Comments »I added some new keys to my Localized.strings files:
"HOME_TEAM" = "Home team"
"AWAY_TEAM" = "Away team"
Then I got this error from Xcode:
Read failed: The data couldn't be read because it isn't in the correct format
It took me a minute but when I found what caused the error I had to smile. I simply forgot the semicolons at the end of each line:
"HOME_TEAM" = "Home team";
"AWAY_TEAM" = "Away team";
Those poor semicolons! Coding in Swift really makes you forget they even existed in the first place 😉
1
Davidsaid atHi Jorn! If you are dealing with the translation of strings, my suggestion is to try a software localization tool with a flexible and user friendly work interface, where you can invite your localization team to work on the translation projects.
2
Jörnsaid atHi David,
thank you for your comment! Yes, I would definitly use a localization tool for bigger projects. To be honest, this post was only half-serious. Just a little obituary for the semicolon character which seems to go extinct with the advent of Swift…
Best regards,
Jörn
3
Riyan Pratamasaid atBonjour, Joern!
You literally saved my time. I am dealing with this problem few hours, and it turns out into missing semi colons.
Just a little question, you said that you’ll use localization tool for big project. What tool do you use? I am waiting your answer on my email.
Thank you so much.
4
J Smithsaid atThanks for the help!
5
namesaid atthanks bro
6
Elon Marksaid atThis tool can help solve this problem, just select your localizable.strings file, it will help you find out which line format is wrong, it can save a lot of time
[https://localizable.appdevtool.io/](https://localizable.appdevtool.io/)