10

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.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Jacek Łyp
  • 173
  • 8
  • Apple talk about xcodebuild -importLocalizations in their pdf and video but it seems it's not supported yet in Xcode 6.1.1. – alexk7 Mar 06 '15 at 22:17
  • Mine crashes too. I made a sample project and can successfully round trip a pseudo localization, but it doesn't work with my real app. Did you ever figure it out? – i_am_jorf Mar 27 '15 at 21:29
  • There is no description of the importLocalizations command on that page in that pdf. (Anymore?) – David Karlsson Apr 09 '15 at 08:30
  • Have you resolved this issue? I get in the same situation now. – Blaszard Apr 15 '16 at 16:53

5 Answers5

4

It importing via the command line works now on Xcode 7

xcodebuild -importLocalizations \
           -project MyProj.xcodeproj \
           -localizationPath es.xlf
Robert
  • 37,670
  • 37
  • 171
  • 213
1

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.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
1

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.

Hashem
  • 453
  • 1
  • 5
  • 17
0

Xcode 7.3.1 has fixed bug with crashing while importing localisations from xliffs. To prevent Xcode before 7.3.1 from crashing, you have to include all localised strings from all targets in your xliff file

psci
  • 903
  • 9
  • 18
-2

The .xliff localization files can now be imported/exported from Xcode's UI:

Select your project file in the Xcode UI. Then use the Editor menu.

Export:
Xcode > Menu Bar > Editor > Export For Localization...

Import:
Xcode > Menu Bar > Editor > Import Localizations...

Xcode Menu > Editor > Import/Export

pkamb
  • 33,281
  • 23
  • 160
  • 191