I use these phrases quiet often. Because of this I spend a lot of time in Google Translate. I am trying to make things a little faster by having a script ready with the phrases.
I have this wrote up and it works, but it is a bit lengthly. I am sure there is a more stable and efficient way to do this. Can someone take a look and tell me what you think.
property theLanguage : {"English", "Spanish", "Portuguese", "French"}
property curLanguage : 1
property theStatements : {"Hello", "Does anyone need help?", "Does anyone want to play a game?", "I don't understand", "Do you speak English?", "I don't speak language.", "I'm sorry", "Yes", "No", "Language Select"}
property sayHello : {"Hello", "Hola", "Olá", "Bonjour"}
property askHelp : {"Does anyone need help?", "Es necesario que alguien ayudarme?", "Será que alguém precisa de ajuda?", "T besoin de personne d'aide?"}
property askGame : {"Does anyone want to play a game?", "Alguien quiere jugar un juego?", "Alguém quer jogar um jogo?", "Quelqu'un veut-il jouer à un jeu?"}
property noUnderstand : {"I don't understand", "No entiendo", "Eu não entendo", "Je ne comprends pas"}
property speak : {"Do you speak English?", "Hablas Inglés?", "Você fala Inglês?", "Parlez-vous anglais?"}
property dontSpeak : {"I don't speak English", "Yo no hablo español", "Eu não falo Português", "Je ne parle pas français"}
property ImSorry : {"I'm sorry", "Lo siento", "Sinto muito", "Je suis désolé"}
property sayYes : {"yes", "sÃ", "sim", "oui"}
property sayNo : {"no", "en", "no", "dans"}
set meRunning to true
repeat while meRunning
activate me
set theOption to ""
set theResponse to ""
set theOption to (choose from list theStatements with prompt "Select Statement - " & (item curLanguage of theLanguage) & ":") as string
if theOption is "false" then error number -128
if theOption is (item 1 of theStatements) then
set theResponse to (item curLanguage of sayHello)
else if theOption is (item 2 of theStatements) then
set theResponse to (item curLanguage of askHelp)
else if theOption is (item 3 of theStatements) then
set theResponse to (item curLanguage of askGame)
else if theOption is (item 4 of theStatements) then
set theResponse to (item curLanguage of noUnderstand)
else if theOption is (item 5 of theStatements) then
set theResponse to (item curLanguage of speak)
else if theOption is (item 6 of theStatements) then
set theResponse to (item curLanguage of dontSpeak)
else if theOption is (item 7 of theStatements) then
set theResponse to (item curLanguage of ImSorry)
else if theOption is (item 8 of theStatements) then
set theResponse to (item curLanguage of sayYes)
else if theOption is (item 9 of theStatements) then
set theResponse to (item curLanguage of sayNo)
else if theOption is (item 10 of theStatements) then
set pickLanguage to (choose from list theLanguage with prompt "Select Language") as string
if pickLanguage is "false" then error number -128
set curLanguage to 0
repeat with i from 1 to number of items in theLanguage
set x to item i of theLanguage
set curLanguage to curLanguage + 1
if x is pickLanguage then exit repeat
end repeat
end if
set the clipboard to (theResponse as text)
end repeat