Monday, 21 May 2012

Things learned about multi-language support (localization)

As I mentioned in previous post, like to share with you a few things I learned about multi-language support (localization) when I worked on V1.01 of Where Is It - Smart Kids Edition.

1. If you want to do it, make sure you got all the settings done in first version.

I learned this lesson in a painful way - as I originally planned about it, and created a "Localizable.strings" in Version 1.0 and put in all the key/string pairs in it, but then I totally forgotten about clicking on "+" to create localized version of the file. Therefore when I started adding in English, Spanish and the 2 Chinese versions in Version 1.01, I got a few problems:

a) the file location has changed. In Ver 1.0, the file is in the same directory as others. In Ver 1.01, each "Localizable.strings" file is located in it's own sub-directory (one each language). During testing, I found that if I installed Ver 1.0 and then upgrade to Ver 1.01, it will NOT pick up any of the different language versions, everything still in English. The only fix is to delete the app and then re-install Ver 1.01, which is not a good user experience.

b) I added a few extra key/string pairs in Ver 1.01. Because those upgraded ones will only see the Ver 1.0 file, those new ones were not correctly displayed. For example, I have these 2 new ones added in Ver 1.01. Those who upgraded from Ver 1.0, will get "AppTitle" and "AppTitleSub" displayed instead of the actual string defined.

"AppTitle" = "Where is it?";
"AppTitleSub" = "Smart Kids Ed";

2. Different width problem.

Make sure you check each and every string display in all screens for different languages. Due to difference in length of each string, although you may set the label to auto adjust font size to fit width as below, it's better if you actually check it to make it doesn't get chopped off, go beyond screen width, too small, ...etc.

[mLabel setAdjustsFontSizeToFitWidth:YES];

3. Custom font problem.

I added a few special custom fonts at the beginning, but I found that most fonts only support standard English alphabets. As shown below in first screen below for Spanish version, instead of "Puntuaci√≥n", that special "√≥" is shown as a blank box, and quite a few others as well. The second one for Chinese is even worse, lost everything. In the end, I have to switch back to standard Apple system fonts. But as I am also supporting pre iOS5 versions, have to add extra logic to use a "nicer" font in iOS5, and then different one for older iOS version.

4. Issue with Simulator

I also found that during testing, if you start a test run in Simulator straight from Xcode, then click "Home" to stop it, and then change language on the Simulator, quite frequently it will hung and crash quite badly. The work around I found, is to make sure it's stopped in Xcode first, switch to Simulator to change the language, then switch back to Xcode to start the run.
Also occasionally, I have to select "Clean" to clear everything for the build to pick up the changed language, which is a bit annoying...

5. Hard to tell whether it's right or wrong unless you understand the language.

Another problem I found is, because I don't understand the language, I have absolutely no idea whether it's correct or not - specially when I have to make changes to the string file. For example, due to screen width limitation, I have to merge a few lines and split a few others. I accidentally missed an "o" during the copy-and-paste, and I got absolutely no idea about it until been picked up by others about a week later. Luckily that was before I submit to Apple for approval...

If you need help with translation, better find someone who can speak/read the language. Although Google translation is free, from my experience, the quality is not that accurate sometimes, so don't fully rely on it. There's a web site called iCanLocalize which provides professional translation service, but it's not free.

6. Don't forget about the content in iTunes Connect

Now that you spent the effort in putting in multi-language support for your app. Don't forget to add those different languages in your iTunes Connect setting too! The descriptions, the screen captures, ...etc, not a simple task... I have to admit I don't have the time to finish that part myself :-( ....

7. Don't forget about the culture differences

This is actually from another game I am currently working on. I found that I made a dumb, fundamental mistake by trying to add multi-language support to a game which requires players to work on things based on the 26 English alphabets.... I later realised Spanish or German or French speaking people's alphabet would be quite different from the English one, right? Then what's of point of supporting it in non-English language? Silly me....

So based on above, although Apple has made it quite easy to support multi-language in Xcode, there's still quite a lot of effort involved. To make your life easier,  make sure you try it a few times (try this tutorial) and arrange for all required resources before you start integrating multi-language support in your app.

Hope you find these information helpful and let me know if you have other things to share.  Cheers!

[Update 22/05/2012]
Almost forgotten another one:

8. Game Center content

Inside Game Center achievement and leaderboard setup (also through iTunes Connect), there's also content that can be in multiple languages. So you might have to look into that too.

[Update 13/09/2012]
There's also other stuffs like Storyboard in iOS5, as I never use Storyboard, don't really know much about it. Please have a look at this post for other related info.


  1. Your blog is absolutely amazing; keep up the great work!