Importing .xliff localization files in Xcode 6.0
Asked Answered
E

5

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.

Eaton answered 20/10, 2014 at 21:59 Comment(4)
Apple talk about xcodebuild -importLocalizations in their pdf and video but it seems it's not supported yet in Xcode 6.1.1.Crosspurpose
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?Gerfen
There is no description of the importLocalizations command on that page in that pdf. (Anymore?)Fugitive
Have you resolved this issue? I get in the same situation now.Guevara
R
4

It importing via the command line works now on Xcode 7

xcodebuild -importLocalizations \
           -project MyProj.xcodeproj \
           -localizationPath es.xlf
Roguish answered 3/12, 2015 at 13:35 Comment(0)
M
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.

Molten answered 24/3, 2016 at 14:42 Comment(0)
T
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.

Tullis answered 10/5, 2016 at 9:23 Comment(0)
M
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

Municipality answered 1/6, 2016 at 9:36 Comment(0)
G
-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

Gaylenegayler answered 26/8, 2015 at 22:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.