Friday, August 7, 2009

Translations and Xcode

Chris Hanson has a really handy post today. In the localization chapter of Beginning iPhone Development, we mentioned that Apple recommended using the ISO two letter language code for your localizations, but that Xcode used the older style language codes for your development base language. Chris shows how to work around this inconsistency.



6 comments:

Michael said...

Thanks again.

While we are talking about localisation are you aware that the iPhone does not support the en_GB localisation (only the en_GB locale).

Not sure if it's a bug but probably not. After all some ten (?) years ago Apple suddenly decided that UK users could no longer have a "Wastebasket" but would have to make do with the "Trash" instead.

Jeff LaMarche said...

Michael:

Honestly, I haven't worked much with localizations since I wrote the chapter in the book over a year ago. Although I always write applications with an eye toward localization, I'm rarely, if ever, involved with actually doing the localization.

That being said, when we were originally working on the book in the SDK 2.0 beta days, many parts of localization were not working properly. The region-specific localizations, for example, didn't recognize nibs, although they did recognize strings files. We worked around these issues and filed a lot of localization bugs while writing that chapter. They've all been closed by Apple, so I had assumed they had all been fixed, but since none of those bugs were impeding my own work and we designed the chapter's applications so they didn't come into play, I honestly never went back to test whether everything was working as documented.

So, long story short, I don't know if this is a GB-specific problem or something more systemic with localizations because I haven't been working with hit lately. If the en_GB locale is supported, then (based on the documentation when I read it last) en_GB localizations should work, and if they don't, you should file a bug. Not saying it will get fixed promptly, but you should file it to let Apple know. They don't fix things that they don't know people are unhappy with.

Jeff

Michael said...

Thanks Jeff,

I will register a bug tomorrow. I do have a work around for the moment (thanks to Oliver Drobnik aka Dr. Touch). It involves subclassing NSBundle and undef'ing NSLocalisedString to point to my own slightly modified version in my subclassed NSBundle -pretty straightforward really. If anyone needs further details you can get an email address for me at sendmetospace.tel.

AlBlue said...

I found out that XCode was displaying my .strings files as gibberish. Then I discovered that XCode was assuming they were UTF-8 (when UTF-16 is defined as the standard) - clicking on 'Get info' and then putting in 'UTF-16' as the type (then selecting 'reinterpret' rather than 'convert') made the strings spring back to life.

Hope this helps someone else.

Edwin said...

scrub m65 kamagra attorney lawyer body scrub field jacket lovegra marijuana attorney injury lawyer

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels