On 20 Oct 2010, at 11:18, Shane Stanley wrote: On 20/10/10 8:14 PM, "Shaguo" < email@hidden> wrote: Hi all,
How use apple script for international application? For example, display a
dialog and show the message with the local language. Is there any way like
other language?
--
Thanks & Best Regards!
Email:email@hidden <mailto:Email:email@hidden>
Yahoo:email@hidden <mailto:Yahoo:email@hidden>
Blog: http://rashaguo.appspot.com/
勤奋,不断追求卓越...
Copying and pasting from your email: display dialog "勤奋,不断追求卓越..." (I'm sorry, I don't actually know what that means...) The actual AppleScript stuff has to be in English, though. --
You can do it but it's a bit fiddly. You need to create localisation strings and save them with your script as a bundle.
Save your script as a bundle and then in the Finder, right-click and choose "Show package contents"
Create a new folder called English.lproj (or Chinese.lproj or German.lproj and so on)
In that folder create a file called Localizable.strings
In the file enter text in this format:
"Hard work" = "勤奋"; "Yes" = "是的"; "Yes" = "Ja"; "No" = "Nein";
Obviously don't mix German and Chinese - use the relevant Localizable.strings file.
Now, as Shane said - the AppleScript needs to be written in English but AppleScript comes with the necessary commands to do the localizations:
display dialog (localized string "Hard work") buttons {localized string "Yes", localized string "No"} default button 1 with icon caution if button returned of result is (localized string "NO") then error number -128
Steve |