Re: Localized Internals of AppleScript (date Class for example)
Re: Localized Internals of AppleScript (date Class for example)
- Subject: Re: Localized Internals of AppleScript (date Class for example)
- From: Emile Schwarz <email@hidden>
- Date: Sat, 16 Apr 2005 10:52:20 +0200
email@hidden wrote:
Date: Fri, 15 Apr 2005 10:09:53 -0700
From: Paul Berkowitz <email@hidden>
Subject: Re: Localized Internals of AppleScript (date Class for example)
To: AppleScript-Users <email@hidden>
Message-ID: <BE854371.933CC¾email@hidden>
Content-Type: text/plain; charset="US-ASCII"
On 4/15/05 8:46 AM, "Emile Schwarz" <email@hidden> wrote:
There is a difference between the way to set the date (French) and the way to
get the date constants back (English) and I do that in the same script, a two
lines script.
Of course, I do not use Mac OS X like the domestic users do: I use the French
language thus French setting, but why the US constants ?
If the Language is able to do one part why not the second part ?
Because one is a string and the other is a constant. If the constants were
localized, everybody's scripts would only work in their own locale and would
break everywhere else. Why do you think that would be a good thing? The way
it is now, dates, and date parts, work everywhere, and then string
representations of these dates appear correct in the local language on the
local computer.
What would be useful would be some sort of 'as local text' coercion:
weekday of someDate
--> Thursday
weekday of someDate as local text
--> "jeudi"
Thursday as local text
--> "jeudi"
Yes, maybe (probably). But, since AppleScript is able to get the current decimal
character, the current date format etc., it can be good to being able to use the
current constant _AND_ the original constant.
current: the setting of the running OS; decimal character as found in the
Numbers (International) panel, date format as found in the ... Date and Time (or
International) panel, and so on. There is an entry for the Language in the
International panel.
But you could still write scripts that worked in all locales:
if weekday of someDate is Sunday then return -- day off
There would be no way to write such a script if the constant Sunday wasn't
constant everywhere.
You are right.
Did someone recall the situation under OS 7, 8 ?
(all flavors)
Regards,
Emile
_______________________________________________
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