© 2013 All rights reserved.
2

How to localize your iPad (iPhone) application

There are several ways to localize your application, written in Xcode for iPad, or iPhone. The best way is to use “.strings” files and set it to a location to save individual languages.

1. all texts written into application controllers

In order to perform localization, it is necessary to rewrite all the texts from XIB files into controllers.

We do this quite easily, so that all variables we set textual labels and values in application code.

For example:

2. create a file for localization

Create a new file – file type is “.strings”, which will contain individual localizations for all language variants:

 



localize iphone app

 

For example, place the file into the “Supporting Files” and name it “Localizable.strings”

 


localize iphone app

 

Navigate to the file and look into the pane “Info Pane” (usually right) and click on the “+” button to add new language versions:

 

localize iphone app

 

Set values for each language like this example:

Section localizable (English):

Section localizable (Czech):

3. Calling localize strings:

Now we call NSLocalizedString function that automatically connects and loads the translations of these strings:

Thus the function load the value for key “Error” and stored in the variable “val”. Now we can continue working with this variable.

If you want to check the language setting, you can call:

This code list the current language in the console.

It is necessary before adding new language to clear the cache and delete the application in device (simulator) and upload again:

 



localize iphone app

 

4. Change language to the iPad

The language is automatically loaded by the settings in your device:

 



localize iphone app

 

Comments are closed for this page

Carla

Hi!
If you’re interested in a tool to collaboratively localize iOS apps for iPad or iPhone, I suggest you give poeditor.com a shot.
It’s a very user-friendly online translation platform that handles .strings files too, along with other popular language file formats.
You’ll see that it has a sum of very useful features to aid your localization workflow, like set reference language and translation memory.
Cheers and good luck with your projects!

Thanks, finally found out why it didnt work for me… did everything except clearing the cache before reading this… 3 hours wasted!

About
Hi, i am programmer from the Czech Republic. I love web development (Ruby, Ruby on Rails, PHP, Nette) and iOS development (Objective-C, Cocoa).
To cooperate, here is my phone:
+420 608 836