Re: Localization
Re: Localization
- Subject: Re: Localization
- From: Emmanuel <email@hidden>
- Date: Thu, 9 Jan 2003 11:18:20 +0100
At 10:39 AM -0500 08/01/03, Steve Roy wrote:
Hi!
Is it possible to localize AppleScripts?
What I'd like to localize is the 'display dialog' statements. In many places I
have error checks of the following form.
try
do something
on error
display dialog "Some message." buttons {"Cancel", "Continue"} ,
default button 2 with icon caution
end
First it'd be nice to be able to have text messages appropriate for
the current
language. Any way to check the language and do an if statement? Or
is there some
more sophisticated way to do it?
Then what about the button names? Many of them are standard, like OK
and Cancel.
Is there any constant we can use instead of passing textual button names?
Smile (for OSX) has a mechanism for that. If Smile may be part of
your solution, I'll be glad to send you more information about it
(that stuff will be public in little time). Basically, you would
finally write
display dialog (Localize "Some message") buttons Localize {"Cancel",
"Continue"}
and Smile would care about the language.
Also, Smile's dialogs [will soon] work as you suggest: you provide
"keys" as the button names, and separate localization dictionaries
provide the translation of each "key" into each language. Users can
add and edit such localization dictionaries.
I'm not sure I dreamt this or not, but I have this memory of trying this:
display dialog "Hello!" buttons OK -- OK not between quotes
and it worked! I just tried it in Mac OS X 10.2.3 and it doesn't. Anyone else
saw that?
Not me. Though, I suppose you could get it to work in Smile by running first:
------------------- untested :-)
set OK to a reference to Localize "OK"
---------------------------
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.