Mike Akers
Mike Akers

Reputation: 12247

How do I localize multiple files at once in Xcode?

In the process of localizing my app, I have about 50 resources (mostly xibs) that need to be localized. I know how to add a localization for each file, but it's a pretty time consuming process to open the info panel and add the localization for each file.

Is there any way to select multiple files and add a localization to each of them in one shot?

Edit to add: Is this a place where AppleGlot or iLocalize can help? I haven't yet looked at those tools.

Upvotes: 4

Views: 3297

Answers (4)

BiGGA
BiGGA

Reputation: 333

The answer is in the other post here

In essence, you have to create xx.lproj directories for all your languages. Then copy all localized files to their respective directories. Now your lproj dirs should have the files with the same name (but with different localized contents). Then you add all files from all dirs into Xcode. Xcode will assign them to appropriate locales based on the lproj dirs where they reside.

Upvotes: 0

EricS
EricS

Reputation: 9768

Selecting multiple files in the left/navigator pane and then adding localizations via the right/utility pane is supposed to work, but doesn't. I filed bug #9276560 against Xcode 4.0.1.

If you need to support a lot of languages, this can help:

  1. Click on file #n
  2. Add one localization
  3. Repeat steps 1 and 2 for all files
  4. Click on the project in the left/navigator section
  5. In the project info pane, add localizations

What that does is add every previously localized file to the new language(s). You'll still have to add 50 files separately, but at least you won't have to perform 50 operations times the number of languages. In my case, that saved me several hundred steps.

Upvotes: 0

Earl Claridad
Earl Claridad

Reputation: 677

Have you tried using ibtool? This tool, which runs from the Terminal, can list the classes or objects in a nib files and can also dump the localizable strings into a plist.

I haven't tried this tool though, but you can find more info by typing "man ibtool" in the Terminal.

Upvotes: 1

Eric Petroelje
Eric Petroelje

Reputation: 60508

Just create a directory for the language you are localizing for if it isn't already there (e.g. "en.lproj") and copy all the files there. Then go into xcode and add the newly copied files to your project.

Upvotes: 1

Related Questions