Re: Getting the default language with AppleScript
Re: Getting the default language with AppleScript
- Subject: Re: Getting the default language with AppleScript
- From: Emmanuel <email@hidden>
- Date: Sun, 25 Jul 2004 16:51:45 +0200
Augmenting Axel's record:
Axel is 10.3.4 (fr_FR)
Emmanuel is 10.2.8 (en_US)
======
$ defaults read com.apple.dock loc
Works for: Peter, dev_sleidy, Axel, Emmanuel
Doesn't work for: Paul (S.), Martin
======
$ defaults read com.apple.systempreferences AppleIntlCustomFormat
Works for: Martin, Paul (B.), dev_sleidy
Doesn't work for: Alexandre, Axel, Emmanuel
======
system attribute "LANG"
--> ""
According to Paul (B.), this returned valid info under Jaguar or earlier.
======
$ defaults read -g AppleLocale
--> fr_FR
Works for: Paul (S.), Paul (B.), Martin, Bill, Axel
Doesn't work for: Emmanuel
======
$ defaults read -g AppleLanguages
--> (French, English,German,Dutch,Italian, Japanese, Spanish, da, fi, ko, no, pt,sv,"zh_CN","zh_TW")
Works for: John, Paul (B.), Bill, Paul (S.), Axel, Emmanuel
Doesn't work for: -
======
So far, my proposition is:
------------------------
on UserLanguage()
set x to system attribute "LANG"
if x = "" then set x to do shell script "defaults read -g AppleLocale"
find text "^[^_]+" in x with regexp and string result
end UserLanguage
------------------------
Emmanuel
_______________________________________________
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.