Programming Languages Hacks

Importanti regole per linguaggi di programmazione rilevanti come Java, C, C++, C#…

  • Subscribe

  • Lettori

    I miei lettori abituali

  • Twitter

iOS NIB Localization in Localizable.strings

Posted by Ricibald on June 3rd, 2011


I want to localize my app AllSync but I was taken by a little frustration.

Following this good guide you can see that there are two main way to localize your iOS (iPhone/iPad) app:

  • localize strings using Localizable.strings
  • localize single nib file creating one version for each
The second point is very frustrating for three reasons:
  • you have to mantain updated all version of your nib localized files
  • there are specialized sites like icanlocalize that translates only your Localizable.string, not your nib files
  • you have to take care about the resulting layout of single translation
The problem:
I want to localize my nib files in the same way of using Localizable.strings

A possible solution can be to externalize in code every text setting but is a tedious process and you can’t use the flexibility of xcode 4. The real solution I hope will be used by many of you is this:

The solution:

Create an extended version of iOS user control that automatically translates every single text

Simple to obtain: just see this extended UIButton

@interface UIButtonThemed : UIButton

@implementation UIButtonThemed
- (id)initWithCoder:(NSCoder *)aDecoder {
    if ((self = [super initWithCoder:aDecoder]))
        self.titleLabel.adjustsFontSizeToFitWidth = YES;
        NSString* text = NSLocalizedString(self.titleLabel.text, nil);
        [self setTitle:text forState:UIControlStateNormal];
        [self setTitle:text forState:UIControlStateHighlighted];
        [self setTitle:text forState:UIControlStateDisabled];
        [self setTitle:text forState:UIControlStateSelected];
	return self;

You can use it inside xcode 4 configuring the base class for your control:

Then you can see my italian Localizable.strings:
"Sync" = "Sincronizza";
"Settings" = "Impostazioni";
"Help" = "Guida";
"Share" = "Condividi";
"Rate us" = "Votaci";
"Follow us" = "Seguici";
And the corresponding result:

12 Responses to “iOS NIB Localization in Localizable.strings”

  1. Maik Mwes Says:


    you can extract strings from your nib with ibtool –generate-strings-file name.strings name.xib via the command line .
    Another more comfortable way is translationWizard. May have a look on it: Http://


  2. Roberto Mazzone Says:

    Con xCode 4.2 e il nuovo iOS 5, basta solo aggiungere le localization nella main storyboard e si aprir una specie di men, da questo men possibile cambiare direttamente lingua tramite la main storyboard, senza usare codici ne niente

  3. Says:


    This is my Excerpt…

  4. Jay Says:

    You can actually automate this entire process and not have to touch any line of code or command line by using TraductoPro app

  5. optometrist in winnipeg Says:

    Keep on working, great job!

    Visit my web-site :: optometrist in winnipeg

  6. plagiarism avenger|plagiarism avenger review|plagiarismavengerreview Says:

    You can certainly see your skills within the paintings you write. The arena hopes for even more passionate writers like you who are not afraid to say how they believe. At all times follow your heart.

  7. summ3r Says:

    If you’re interested to collaboratively translate web software, PC software, mobile software or any other type of software, I warmly recommend POEditor, a localization platform that my team developed not long ago, which will probably help you get your translation projects done a lot faster and easier.
    POEditor has an intuitive work interface, which makes it easy to use for technically inexperienced translators. It is perfect for crowdsourcing and it has a lot of management-oriented features, that give full control over the translation workflow, which you can find enlisted on our website here:
    You can import from multiple language file formats or just use our REST API.
    Feel free to try it out and recommend it to developers and everyone who might find it useful.

  8. Says:

    Hey there would you mind stating which blog platform you’re using?
    I’m going to start my own blog soon but I’m having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m
    looking for something unique. P.S Sorry for getting off-topic but I had to

  9. Електронно заключване с чип за Вашия вход. Повишете сигурността на дома си! Цени от 100 лв. - Says:

    I don’t even know how I ended up right here, however I believed this publish used to be good. I don’t recognize who you might be but certainly you’re going to a famous blogger if you happen to are not already. Cheers!

  10. Read through much more Says:

    eleventh elfishly elflocks elicited elicitor elidible
    eligible eligibly. In Geoffrey of Monmouth’s Hisztory of the Kings oof Britain
    (Historia Regum Britanniae) can be seen ass the start of the
    modern tradition about King Arthur. ——————————————————————————– 46.

    Also visit my page; Read through much more

  11. Says:


  12. super mario 64 Says:

    whoah this weblog is wonderful i love reading your articles.
    Keep up the good work! You realize, many individuals are
    hunting around for this info, you can aid them greatly.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>