• 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
Re: What is the System language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the System language


  • Subject: Re: What is the System language
  • From: Jean-Christophe Helary <email@hidden>
  • Date: Thu, 12 May 2011 21:57:08 +0900

> do shell script "defaults read 'Apple Global Domain' AppleLocale"

After some more investigation, it seems that AppleLocale gives the locale built from the preferences set in System Preferences > Language & Text > Formats.

For example I just set the formats (date and currency) to a standard US format and now I get:

suzume:~ suzume$ echo $LANG
en_US.UTF-8
suzume:~ suzume$ defaults read 'Apple Global Domain' AppleLocale
en_US_POSIX
suzume:~ suzume$

Before that I had a custom setting based on a French date and a Japanese currency... Which was reflected in the value I got from reading AppleLocale...

So it seems that the most accurate way to find the language "environment" (as opposed to "locale" in the POSIX meaning) is to check the first element of the list given by:

defaults read NSGlobalDomain AppleLanguages

Anything related to a locale value may not be related to that preferences and in the end probably only affects Terminal internals.

Jeez, that's a mess !


Jean-Christophe Helary
----------------------------------------
fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en > fr)
tweets: http://twitter.com/brandelune

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >What is the System language (From: Ronald Hofmann <email@hidden>)
 >Re: What is the System language (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: What is the System language
  • Next by Date: Re: Quit Handler... What Am I Missing Here?
  • Previous by thread: Re: What is the System language
  • Next by thread: Re: What is the System language
  • Index(es):
    • Date
    • Thread