Re: Days and hours
Re: Days and hours
- Subject: Re: Days and hours
- From: Christopher Nebel <email@hidden>
- Date: Wed, 19 Oct 2005 13:23:04 -0700
On Oct 19, 2005, at 5:12 AM, Yvan KOENIG wrote:
Le 19 oct. 2005 , à 13:49, Mark J. Reed a écrit :
On 10/19/05, Bernard Azancot <email@hidden> wrote:
set mon to (choose from list {January, February, March, April, May,
June, July, August, September, October, November, December}
I would like to know how could I translate this list in a french
user friendly list and make the script function without issue.
Those month names above are constants, not strings. When they
are displayed in the "choose from list" dialog box they should use
whatever your locale settings are. So if your machine has French
as its primary language, you should get a list of Janvier,
Fevrier, etc. With the ^ in Aout, even...
I apologize Mark.
I am working with a french system.
The months are displayed with three letters IN ENGLISH.
I get
Jan
Feb
Mar
Apr
May
Passing a constant to "choose from list" or any other scripting
addition that expects text, such as "display dialog", will result in
the four-character code for that constant. In the case of the
months, these happen to be the English abbreviations, because English-
speaking programmers created them.
You can coerce a constant to a string *outside* of the scripting
addition call (try saying "January as string"), but that won't give
you what you want either, because that literally converts the
constant name into a string, so you still get "January" no matter
what your locale is. (I maintain that this particular feature was a
really stupid idea for precisely this reason -- most people, it turns
out, wanted it to do this precise task, and it doesn't work if you're
not an English-speaker. Of course, now we're stuck with it.)
There isn't any really good way to get the localized month names; the
best I can suggest at the moment is to use the "localized string"
command, which has been available in Studio for some time and in
AppleScript at large as of Mac OS X 10.4. (You could, of course, try
picking apart date strings, but that's probably more trouble than
it's worth.)
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden