Re: Country code or name
Re: Country code or name
- Subject: Re: Country code or name
- From: Chuck Soper <email@hidden>
- Date: Mon, 15 Sep 2003 10:48:35 -0700
At 7:40 PM -0700 9/14/03, mmalcolm crawford wrote:
On Sep 12, 2003, at 8:44 AM, Simon Stapleton wrote:
Well, I've been loking all over the place, but I can't seem to find
it. I need to be able to at least guess the current user's country
(not timezone, that's not specific enough, or language, that
doesn't work either). I'd like to avoid having to code this all up
myself, but can do if needs be.
It's not entirely clear what your goal is here. Do you need to know
where they are geographically, or are you interested in their
"preference". If the latter, then you may be able to make a good
guess from System Preferences. The first language returned from the
AppleLanguages setting may give enough information (if you just get
"en" back it's a reasonable guess that it'll mean "USA"...). For
more on interpreting the codes, see:
<http://www.stepwise.com/Articles/Technical/2003-04-03.01.html>
Note also the various LocaleRef functions in Carbon (e.g.
<http://developer.apple.com/documentation/Carbon/Reference/Locale_Utilities/locale_refchap/function_group_3.html>).
mmalc
Is there anyway that I can grab the text in the "System
Preferences:Date & Time:Time Zone" Closest City field? For example,
if the text reads, "New York - U.S.A.", how do I programmatically get
that text from a Cocoa application?
Chuck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.