Re: Getting the default language with AppleScript
Re: Getting the default language with AppleScript
- Subject: Re: Getting the default language with AppleScript
- From: Paul Skinner <email@hidden>
- Date: Wed, 7 Jul 2004 07:40:26 -0400
On Jul 6, 2004, at 4:16 PM, Paul Berkowitz wrote:
On 7/6/04 12:35 PM, "Paul Skinner" <email@hidden> wrote:
wa wa wah...
???
It's the sound of a intermittently open/muted trumpet telling you
that you were incorrect. : )
On Jul 6, 2004, at 5:26 PM, Martin Orpen wrote:
Nice one Paul - and no need to type "-globalDomain" as "-g" is good
enough:
Noted. I chose it for clarity.
On Jul 6, 2004, at 10:15 PM, Bill wrote:
...
$ defaults read -g | grep AppleLanguages
or just 'defaults read -g AppleLanguages'
OMM--> AppleLanguages = (fr, en, ja, de, es, it, nl, sv, no, da,
fi, pt, "zh_CN", "zh_TW", ko);
So, on my machine "zh_TW" is the default language at this moment.
bill
I only have english installed, but here french is listed as the default
language (after changing it in the Intl. pref pane). I don't think that
AppleLanguages is a valid method for determining the current language
in use. While French is still selected AppleLocale returns 'en_US'.
<http://developer.apple.com/documentation/Cocoa/Conceptual/
UserDefaults/Concepts/DefaultsDomains.html>
...
NSGlobalDomain
The global domain contains defaults that are read from a users
defaults database and are applicable to all applications that a user
runs. Many Application Kit and Foundation objects use default values
from the NSGlobalDomain. For example, NSRulerView objects
automatically use a users preferred measurement units, as stored in
the users defaults database under the key AppleMeasurementUnits.
Consequently, ruler views in all applications use the users preferred
measurement unitsunless an application overrides the default by
creating an AppleMeasurementUnits default in its application domain.
Another NSGlobalDomain default, under the key AppleLanguages, allows
users to specify a preference of languages as an array of strings. For
example, a user could specify English as the preferred language,
followed by Spanish, French, German, Italian, and Swedish.
Languages
If a user has a value for the AppleLanguages default, then
NSUserDefaults records language-specific default values in domains
identified by the language name. The language specific domains contain
defaults for a locale. Certain classes from the Foundation Framework
(NSCalendarDate, NSDate, and NSTimeZone, NSString, and NSScanner, for
example) use locale defaults to modify their behavior. For example,
when you request an NSString representation of an NSCalendarDate, the
NSCalendarDate looks at the locale to determine what the months and
the days of the week are named in your preferred language.
...
It should be easy.
Paul
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.