Re: Getting the default language with AppleScript
Re: Getting the default language with AppleScript
- Subject: Re: Getting the default language with AppleScript
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 24 Jul 2004 01:23:26 -0700
On 7/23/04 11:57 PM, "Bill" <email@hidden> wrote:
>
>
>
> I had him check System Preferences/International/Formats and his is
>
> set to
>
> "United States". (Even when I changed mine to "Custom", logged out and
>
> in,
>
> I still got "en_US" for mine.) He has BSD installed normally.
>
>
Paul,
>
>
I tried to modify the setting in System
>
Preferences/International/Formats, each time I change the region, the
>
shell command "defaults read -g" reflects the change immediately.
>
>
-- in Terminal, Hong Kong, China
>
$ defaults read -g AppleLocale
>
en_HK
>
>
-- change to India
>
$ defaults read -g AppleLocale
>
en_IN
>
>
-- or change to Zimbabwe
>
$ defaults read -g AppleLocale
>
en_ZW
>
>
>
BTW, I guess AppleLocale doesn't represent the default language, you
>
may investigate AppleLanguages.
>
>
-- in Terminal
>
$ defaults read -g AppleLanguages
>
(en, "zh_TW", "zh_CN")
>
>
I guess the first item (en, on my machine) represents the default
>
language.
Sort of. That's the list you see in System Prefs/International/Languages -
the prioritization of languages. Mine's much longer:
(en, fr, ja, de, es, it, nl, sv, nb, da, fi, pt, "zh-Hans", "zh-Hant", ko)
even though I don't in fact read most of them. Usually I'm looking for the
locale, in fact, which will determine Date and Time formats too if you
haven't customized them further. I've been reading up on this. There's a
rather complicated system where customizations take precedence over
defaults. It could be that if a more localized preference is used first, the
global domain doesn't get called.
There's also at least one more locale default entry:
defaults read com.apple.systempreferences AppleIntlCustomFormat
{
AppleCurrencySymbol = "\\U20ac";
AppleDateOrder = 1;
AppleDecimalSeparator = ",";
AppleIntlCustomICUFormats = 7;
AppleIntlCustomLocale = "en_US";
AppleIntlCustomResID = 16383;
AppleLongDateSeparator3 = ".";
AppleMetricSystem = -1;
AppleShortDateFormat = 224;
AppleShortDateSeparator = ".";
AppleThousandSeparator = ".";
AppleTimeCycle = 0;
}
I'd been setting some custom formats which is why all those are listed there
- normally the locale would take are of it all. I'm waiting to hear back
from my friend if he's got that one. There's an easy way to find any locale
pref that might be operable:
defaults find locale
Found 1 keys in domain 'Apple Global Domain': {AppleLocale = "en_US"; }
Found 1 keys in domain 'com.apple.systempreferences': {
AppleIntlCustomFormat = {
AppleCurrencySymbol = "\\U20ac";
AppleDateOrder = 1;
AppleDecimalSeparator = ",";
AppleIntlCustomICUFormats = 7;
AppleIntlCustomLocale = "en_US";
AppleIntlCustomResID = 16383;
AppleLongDateSeparator3 = ".";
AppleMetricSystem = -1;
AppleShortDateFormat = 224;
AppleShortDateSeparator = ".";
AppleThousandSeparator = ".";
AppleTimeCycle = 0;
};
--
Paul Berkowitz
_______________________________________________
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.