What? English is not the only spoken language in the world?
Nope and that’s why many developers are leaving behind a big chunk of potential users by providing their application in English only.
That’s too bad because Apple is providing an easy way to present the application in multiple languages. It’s called Localization and Internationalization.
Here is how it works at a very high level. A link to a tutorial is provided at the bottom of this post to go in more details:
Internationalization (also called i18n) is the process of designing an app to facilitate localization. This part is the coding part done by developer.
Localization (also called l10n) is the cultural and linguistic adaptation of an internationalized app. This task is performed by a translator (not a developer this time). The translated text is then integrated by the developer into the app.
Let’s say that my application has a setup screen for the user to change the app configuration. I would need to show the word “Setup” on the screen but this won’t work in other languages obviously. The translation in French for example is “Configuration” (used in English also btw).
So instead of hard coding the word, on the screen, I create a bundle for English and a bundle for French and will populate a token string with their respective translation. I decided to name all my tokens with the english word in upper case followed by “_TOKEN. In our example, the token would be named “SETUP_TOKEN”. This allow me to easily understand in the code what word the token represents.
In the english bundle:
“SETUP_TOKEN” = “Setup”
In the French bundle:
“SETUP_TOKEN” = “Configuration”
I can then use NSLocalizedString to replace the token with the work “Setup” in the appropriate language. In this case, adding new languages is just the matter of adding new bundles and translating the words or sentences.
It may also be required to have 1 nib per language. In this case it’s better to wait till the application is finished to copy the existing nib and adapting it to the new language.
How do you what is the preferred spoken language for the iPhone user and which bundle should we use? This is handled behind the scene by the SDK. The SDK is looking up the preferred language on the user iPhone (changeable in the Settings section) and then chooses the most appropriate language. If the user is having the iPhone in French then French will be chosen. If the user is having the iPhone in English (American, British, …) then English will be chosen. If the user’s iPhone is in a different language not supported by the application (let’s say German) then a default language (in my case English) will be chosen by the SDK.
As I mentioned in a previous post, for my App#1, I’m planning to build it to support multiple languages as my future app will be used in multiple countries around the world. Being English/French bilingual, I’ll do it in both languages right away. Later on, if enough people download the application, I’ll work with people fluent in other languages (Spanish, Russian, Chinese,…) to add those languages to the application.
In general, it is easier to start the Internationalization of your application when you start it rather than adding it when the app is done so do it right away if you know that your app may be in multiple languages. Even if you’re not sure, it’s not a lot of extra work to add the internationalization right away.
Having to go through multiple tutorials to understand how to setup i18n and l10n, I found this localization tutorial to be the best.
Have fun! Amusez vous!
Very shorts, simple and easy to understand, bet some more comments from your side would be great
Very nice and informative article. Thanks for the quality content and I hope you update your blog frequently as I`m interested in this topic. I`ve already bookmarked this article. Thanx!
great post, thanks for sharing
It’s a shame you haven’t posted anything since March 2010. I’m beginning iPhone development myself and the posts you have done were a great help…
Valuable info. Lucky me I found your site by accident, I bookmarked it.
There are some interesting cut-off dates in this article but I don’t know if I see all of them heart to heart. There’s some validity however I’ll take maintain opinion till I look into it further. Good article , thanks and we wish extra! Added to FeedBurner as effectively
Good day! I simply want to give an enormous thumbs up for the nice data you will have right here on this post. I will probably be coming back to your blog for extra soon.
There are some fascinating points in time in this article but I don’t know if I see all of them middle to heart. There’s some validity but I’ll take maintain opinion till I look into it further. Good article , thanks and we wish more! Added to FeedBurner as properly
Oh my goodness! an amazing article dude. Thanks However I’m experiencing concern with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting equivalent rss problem? Anybody who is aware of kindly respond. Thnkx