Reputation: 268
I want to add some new languages to my projects but after clicking Editor -> Export For Localization -> Save
, I get the following error:
Localization failed reading "/var/folders/rs/_qctp1n15gl81l8s0rm7njnh0000gn/T/Xcode3SourceStringsAdaptor-2E68CCA9-A2EA-4EE4-8ED1-A9250721AFC1/Localizable.strings"
Please address the issue at file location 990
I have tried it in different projects, some working well some have this error. All projects have the same languages and are already localized I just have to add some other languages.
I have no idea what's the reason or how I can solve this problem.
I am grateful for any response!
Upvotes: 21
Views: 4026
Reputation: 11
Be careful with XIB/Storyboard files that are localized but don't have any UI element to localize.
Those files happen to generate empty .strings
files. Those empty .strings
files cause the parser to throw an error, like the following: Failed to read strings file, underlying error: The data couldn't be read because it isn't in the correct format.
Removing the localization for those files worked for me.
Upvotes: 1
Reputation: 85
In my case, I play the problem with these steps:
In xcode 6.3: 1. Do a regex search for \@\".\'.\" in the whole project. 2. I found no localized string have ', but quite a lot of sting in FMDB source code has SQL comment with '...
So, I Download the xcode 6.2 again, install it and "Export for Localization..." comes back!(spent me half and hour)
Upvotes: 0
Reputation: 1081
There's an Xcode 6.3.2 GM seed available in the developer portal downloads section. It fixed the problem for our project.
Upvotes: 2
Reputation: 21426
Accepted answer has an issue: after exporting and import back localisations - escape sign is gone!
As @progrmr mention in comments - there is better workaround to replace '
with left single quote ’
sign! (option - shift - ] on OS X)
Upvotes: 3
Reputation: 284
The issue seems to be in Xcode 6.3, that the XLIFF parser suddenly chokes on unescaped quotes ('). A solution seems to be to escape (with a backslash) all instances of quotes in your source code, e.g replace @"Foobar's" with @"Foobar\'s"
.
Upvotes: 15