Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while "Export For Localization.." Xcode 6.3

Tags:

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!

like image 301
NimzApps Avatar asked Apr 13 '15 17:04

NimzApps


People also ask

How do I add localization files to Xcode?

Right click your project folder, select 'New File' , then scroll down to find 'Strings', select it and click 'Next'. Then name the file as 'Localizable. strings' and click 'Create'.

How do you perform localization in iOS Swift?

Click on iOS->App/Single View App->Next. Name your project and select the language as Swift. Select a desired location and click on Create. To start with Localization, click on your Project Name -> go to Info Tab -> Under Localizations, click on the '+' button.

How do I export files from Xcode?

Export localizations using XcodeIn the Project navigator, select the project, then choose Product > Export Localizations. In the dialog that appears, enter a folder name, choose a location, choose the localizations, and click Export.

What is localized string key Swiftui?

The key used to look up an entry in a strings file or strings dictionary file.


2 Answers

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".

like image 70
hakanw Avatar answered Sep 18 '22 18:09

hakanw


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)

like image 20
skywinder Avatar answered Sep 20 '22 18:09

skywinder