• 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: What is the System language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the System language


  • Subject: Re: What is the System language
  • From: KOENIG Yvan <email@hidden>
  • Date: Thu, 12 May 2011 15:38:29 +0200


Le 12 mai 2011 à 15:18, Jean-Christophe Helary a écrit :



On 12 May 2011, at 20:23, KOENIG Yvan wrote:

Le 12 mai 2011 à 12:52, Ronald Hofmann a écrit :

Hi all,
I´m looking for an apple script snippet to find out what language my system is.
A UNIX script would also do.

do shell script "defaults read 'Apple Global Domain' AppleLocale"

Here is the last word, from Apple:

http://developer.apple.com/library/ios/#documentation/MacOSX/ Conceptual/BPInternational/Articles/ChoosingLocalizations.html

AppleLocale is for the system locale (basically a set of values reflecting choices like area/currency etc) and AppleLanguages is for preferred languages, of which the first is the language in which the applications will be displayed (if a localization is available).

Since SL is a Posix system, I guess that page is relevant:

http://en.wikipedia.org/wiki/Locale

cf. "General locale settings" for what the value expresses.

I suppose that OSX overrides the locale value with the Language value everywhere it is practical but keeps local values for "minor" items like the ones described in that section of the article.

When I want to know the language in use it's to force my scripts to use French messages when the system behave this way.
So, for such use, my handler


--=====

on parle_anglais()
return (do shell script "defaults read 'Apple Global Domain' AppleLocale") does not start with "fr_"
end parle_anglais


--=====

is OK

Often, I wish to display French message when the driven app behave this way.
In such case, when the app is an iWork one, I use ;


--=====

on parleAnglais(the_App)
	local z
	try
		tell application the_App to set z to localized string "Cancel"
	on error
		set z to "Cancel"
	end try
	return (z is not "Annuler")
end parleAnglais

--=====

It's required because often, I run iWork apps in a language different from French to check this or that behavior.

Yvan KOENIG (VALLAURIS, France) 12 mai 2011 15:38:21



_______________________________________________
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
References: 
 >What is the System language (From: Ronald Hofmann <email@hidden>)
 >Re: What is the System language (From: KOENIG Yvan <email@hidden>)
 >Re: What is the System language (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: Re: What is the System language
  • Next by Date: Mounting a laptop volume
  • Previous by thread: Re: What is the System language
  • Next by thread: Re: What is the System language
  • Index(es):
    • Date
    • Thread