• 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: Getting the default language with AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the default language with AppleScript


  • Subject: Re: Getting the default language with AppleScript
  • From: Paul Skinner <email@hidden>
  • Date: Sun, 25 Jul 2004 14:55:28 -0400

Or, for those without satellite imaging... ; )

on UserLanguage()
set x to system attribute "LANG"
if x is "" then
set {prevdelim, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "_"}
set x to text item 1 of (do shell script "defaults read -g AppleLocale")
set AppleScript's text item delimiters to prevdelim
end if
return x
end UserLanguage

On Jul 25, 2004, at 10:51 AM, Emmanuel wrote:

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.


References: 
 >Re: Getting the default language with AppleScript (From: Paul Berkowitz <email@hidden>)
 >Re: Getting the default language with AppleScript (From: Axel Luttgens <email@hidden>)
 >Re: Getting the default language with AppleScript (From: Emmanuel <email@hidden>)

  • Prev by Date: Re: Getting the default language with AppleScript
  • Next by Date: Re: Getting the default language with AppleScript
  • Previous by thread: Re: Getting the default language with AppleScript
  • Next by thread: Re: Getting the default language with AppleScript
  • Index(es):
    • Date
    • Thread