Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing .xliff localization files in Xcode 6.0

Apple has recently introduced a new process for translating files. You no longer have to use genstrings/ibtool for generating .strings file - instead you simply use the .xliff files export/import tool built right into Xcode:

https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html

Unfortunately when I'm trying to import right from Xcode, it crashes. I wanted to test it out using xcodebuild -importLocalizations as is described here (page 68):

https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/BPInternational.pdf

It turns out that there's no such importLocalizations argument for xcodebuild (although there is an exportLocalization)?! (man command confirms this) Am I missing something? This has also been tested in Xcode 6.1.

like image 622
Jacek Łyp Avatar asked Oct 20 '14 21:10

Jacek Łyp


People also ask

How do you import localization?

Import Localizations Using XcodeIn the Project navigator, select the project, then choose Product > Import Localizations. In the import dialog that appears, select the Xcode Localization Catalog folder, and click Import.

How do I create a localizable string in Xcode?

Under the Localizations you add new languages. After you add the language here you select which files you want to localize. Click on the top right button shown in the screen below and select your project under the PROJECT tab. Show activity on this post.


2 Answers

I had the same problem and in my case I figured out that the running SourceTree application was the problem! I closed it and reimported successfully. Maybe it modifies something while importing.

like image 57
Hashem Avatar answered Oct 05 '22 23:10

Hashem


One reason for the crash is, if the xliff file contains any empty localisable strings, then Xcode will crash while importing it.

Re-create the xliff will and make sure there are no strings left blank.

like image 32
Teja Nandamuri Avatar answered Oct 06 '22 00:10

Teja Nandamuri