Extracting & Localizing XIBs (IBTOOL)

If you installed the Command Line Utilities along with Xcode (by default, you did) then you can use IBTOOL to extract strings from your XIB files. The process is simple and very manual. It may be better to consider using a 3rd party tool to help you.

 

Extracting .string files from XIBs

Open Terminal and navigate to your Xcode project repo. To generate a strings file from a XIB, enter the following:

ibtool --generate-strings-file XIBName.strings en.lpoj/XIBName.xib

Repeat for each XIB that needs localizing.

 

Translating your files

The most important thing to remember here is file encodings and string endings. Make sure your localizer uses a good text editor and completes each line with the required quotation marks and semi-colon. You must also keep the file in its original format (usually UTF-8 or 16), or, if required, upgrade the file to UTF-16.

 

Reimporting strings to XIB files

Once you have received your strings from the translator, you will want to 1) create target language duplicates of your XIBs and 2) import strings back into those XIBs. This can be done with IBTOOL again:

ibtool --strings-file xx.lproj/XIBName.strings en.lproj/XIBName.xib –write fr.lproj/XIBName.xib

For example:

ibtool --strings-file de.lproj/MainMenu.strings en.lproj/MainMenu.xib –write de.lproj/MainMenu.xib

We’d really appreciate it if you could rate this post to let us know how useful you found it! :) Thanks!

1 Star2 Stars3 Stars4 Stars5 Stars (13 votes, average: 4.54 out of 5)

Rob

CEO & Founder of Applingua.com

Leave a Reply