• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Internationalization: How to bring the locale in line with the language?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Internationalization: How to bring the locale in line with the language?


  • Subject: Internationalization: How to bring the locale in line with the language?
  • From: Uli Zappe <email@hidden>
  • Date: Wed, 3 Nov 2004 10:44:28 +0100

Hi,

I'm encountering what I think must be a very common problem with internationalization, but I can't find anything about it in the archives.

In http://developer.apple.com/documentation/CoreFoundation/Conceptual/ CFLocales/Articles/CFLocaleConcepts.html, it says:

"In Mac OS X the locale preference need not be the same as the language preference—they are set independently. Users choose their locale in System Preferences > International, using the Region pop-up menu in the Formats pane."

At first, this seems to make sense and provide greater freedom for users.

However, it has one serious drawback. For instance, being a German, I have set both my language and my locale preferences to German. This works fine if the app I use is indeed localized in German.

But if it is not, the GUI will most certainly be in English (which is my second language preference). However, the *locale* is still German. This means that e.g. localized decimal numbers are still displayed as 1.000,00 (= one thousand) and not 1,000.00. But of course, if the surrounding text is in English, I will interpret the numbers in English fashion, too - i.e. I will think that 1.000 is precisely *one*, and not *one thousand*. This can be a serious problem.


Since I write an app that displays a lot of numbers I wanted to get rid of that problem by bringing the locale in line with the language used. However, I can't find a way to do that.


I tried [userDefaults setObject:@"en" forKey:@"AppleLocale"] in the +initialize class method of my app delegate which as far as I know is about the earliest moment you can do something when your app is launching, but apart from the ugly side-effect of having this value written to the preferences plist file, even at this time it's obviously too late: all the formatter objects in IB still use the German locale. Only after a restart of the app (which now reads the respective entry in the preferences plist) the setting takes effect.

So is there no way to bring the locale in line with the language in time?

I'm really baffled cause I think that this is such an obvious problem for internationalization, but I can't find anything about it.

Any ideas?

Thanks in advance for your replies!


Bye Uli ________________________________________________________

  Uli Zappe, Solmsstraße 5, D-65189 Wiesbaden, Germany
  http://www.ritual.org
  Fon: +49-700-ULIZAPPE
  Fax: +49-700-ZAPPEFAX
________________________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Internationalization: How to bring the locale in line with the language?
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: [Solved]RE: Re: How do I get the selected cells?
  • Next by Date: Multiple Documents?! [newbie]
  • Previous by thread: [Solved]RE: Re: How do I get the selected cells?
  • Next by thread: Re: Internationalization: How to bring the locale in line with the language?
  • Index(es):
    • Date
    • Thread