swemoney.com

  • Random
  • Archive
  • RSS

Adding internationalization to XIB files in Xcode 4

I want to post a quick Derrr post about localizing XIB files in Xcode 4 since I just spent a good 2 or 3 hours trying to figure out what I was doing wrong to find I wasn’t really doing anything wrong.

Localization of your Interface Builder files in Xcode 4 is a piece of cake, actually.

  • Select the file you wish to localize.
  • Press Opt+Cmd+1 to open up the file’s info pane.
  • Scroll down to the Localizations section and hit the + button. It just created an English localization automatically for you!
  • Hit the + button again to add as many new languages as you want. You’ll notice that the original file in files pane is now expandable has copies of your XIB with (SomeLanguage) appended to it.
  • You can now select each of these and edit the labels and other things you wish to localize.
  • Clean, Build, Run!

This is where I ran into problems. I changed the language on the device and ran my app to find it still very much in english. I tried everything from deleting and redoing everything to just banging my head against a wall until I thought something might have changed. In the end, after countless google searches, I found one suggestion to delete the app from my device (or simulator), clean and recompile and.. IT WORKED!

Even if it was a few hours of wasted time, I did find some other useful tools for making the localization process much easier in the future. The problem with the easy method above is that if you need to add a button or make some changes, you have to do them to ALL your localized XIB files. But you can easily find a lot of information on using ibtool to automate the process a bit with scripts. This post had a lot of good great information on the subject to I suggest you check it out if you want to make your internationalization life a LOT easier.

    • #xcode
    • #apple
    • #ios
    • #iphone
    • #ipad
    • #development
    • #xcode 4
    • #localization
  • 1 year ago
  • 8
  • Comments
  • Permalink
  • Share
    Tweet

8 Notes/ Hide

  1. kreativerkoffer liked this
  2. rayrx liked this
  3. swemoney posted this

Recent comments

Blog comments powered by Disqus
← Previous • Next →
iOS application development, video games, random thoughts, apple. These are a few of the wonderful things you'll catch on my blog.

Pages

  • Projects
  • Apps
  • Secret Browser

Elsewhere

  • @swemoney on Twitter
  • Facebook Profile
  • tehdnite on Youtube
  • dnite on Digg
  • swemoney on Rdio
  • swemoney on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr