Localization to British English

We have localization of iPhone app in a variety of languges, all working fine. I wanted to do one modification in "British English". I've created Localizale.strings files with en_uk, en_gb, en-gb, en-GB, I can't seem to find one that works right. What's the formula?

iMac, Mac OS X (10.5.2)

Posted on Aug 13, 2008 2:48 PM

Reply
8 replies

Aug 13, 2008 4:36 PM in response to Chunky Lafunga

Most of the English speaking world uses British English, not our silly US English.

colour vs color etc.

I think it's great to hear of people putting such effort into place. It's these little details that make such an app a hair better than others.

Just my 2 cents (in USD).

But back to the question. My experience with locales on other platforms shows you usually use xx_YY where xx is the ISO code for the language and YY (uppercase) is the ISO code for the country. So en_GB should be correct.

See all these fun ISO codes at:

http://en.wikipedia.org/wiki/Listof_ISO_639-1codes

and

http://en.wikipedia.org/wiki/ISO3166-1alpha-2

Aug 13, 2008 7:09 PM in response to RickMaddy

I think it's great to hear of people putting such effort into place. It's these little details that make such an app a hair better than others.

Or, it would be if users could actually try the app before buying. Or if the App Store had a mechanism for purging old inaccurate reviews (or, for that matter, denying reviewer rights to anyone who hadn't actually purchased and therefore used the software).

Dreams...

Aug 17, 2008 11:53 AM in response to Steve Patt

Steve - did you ever figure out a way to make this work?

I too want to an app to be sensitive to en_US and en_GB to ensure I spell "metres" as "meters" for our friends over the pond. Although I can set the locale via Settings on the iphone, it seems to ignore it when picking a Localizable.strings file to use.

My app has an English, en_US and en_GB version of Localizable.strings, and I load the strings like this


NSString strFoo=[[NSBundle mainBundle] localizedStringForKey:(@"foo") value:@"" table:nil];


I can successfully pick up the language and locale with this


CFLocaleRef userLocaleRef = CFLocaleCopyCurrent();
CFStringRef str=CFLocaleGetIdentifier(userLocaleRef);


str contains en_US when the phone is set to English/United States and en_GB when set to English/United Kingdom. However, my en_GB strings are not used.

Has anyone got this sort of thing working? At the moment, seems the only alternative would be for me to override the built in stuff and first attempt to load a localized string from another table based on the current locale, e.g. attempt to load from en_GB.strings, and if that failed, allow the default behaviour....

So it seems the only way to do this is to roll your own localization code instead:

Aug 18, 2008 5:43 PM in response to PaulDixon

I still haven't gotten it to work. However, only slightly off-topic, let me append a bug report which I filed with Apple weeks ago and just got an acknowledgment today on:

Use iPhone settings to set the Language to, say, Spanish, but the Regional
Format to be the United States. A perfectly reasonably setup for, say, a
Spanish-speaking person in the United States.

Now either

{CODE} [[NSLocale autoupdatingCurrentLocale] objectForKey:NSLocaleLanguageCode];

or

[[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]; {/CODE}

returns "en", not "es," although the system somehow knows the correct
language, because it correctly pulls the Spanish strings out of the "es"
file in the Localizable.strings folder. However if the application needs to
know the language for a reason other than what is accomplished by the
Localizable.strings, it fails. Of course one could store a dummy string in
localizable strings and test for that, but that seems a rather crude and
unnecessary workaround.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Localization to British English

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.