Re: What is the System language
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