Re: Localization
Re: Localization
- Subject: Re: Localization
- From: Michael Grant <email@hidden>
- Date: Wed, 08 Jan 2003 14:20:51 -0600
On 1/8/03 9:39 AM, "Steve Roy" <email@hidden> wrote:
>
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?
You should be able to have the script read the dialog strings from a text
file. Use the user's language preference as set in System Preferences to
determine which file to draw the strings from. I don't know offhand exactly
where the language preference is stored, but it shouldn't be hard to find.
(Most likely it's in an XML .plist, but I'm guessing.) That way you wouldn't
need to touch the script itself and could add a new language (as long as
it's listed as an option in the pref pane) any time you wanted just by
adding a new text file with strings for that language. This is pretty much
the way Cocoa applications handle localization, with .strings files inside
the application bundle.
In AppleScript, you might run into text encoding issues at some point since
AppleScript dialogs don't seem to be fully Unicode compliant.
Michael
--
michael grant is being cross examined by rtI's legal team about the events
leading up to that directive
_______________________________________________
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.