Translator Dialog

By Jordyboy on Feb 10, 2007

Translator Dialog, English Too, French, German, Italian, Spanish.

;; Translator Dialog Made By Jordyboy;;
menu channel { 
  Translator:/dialog -ma Translater_Dialog Translater_dialog 
} 
on *:DIALOG:Translater_dialog:sclick:4,1:{ 
  if ($did == 4) { /set %translate-from $did(4).seltext } 
  if ($did == 1) { /set %translate-too $did(1).seltext  } 
} 

on *:DIALOG:Translater_dialog:init:*:{ 
  /did -a Translater_dialog 4 French 
  /did -a Translater_dialog 4 Spanish 
  /did -a Translater_dialog 4 German 
  /did -a Translater_dialog 4 Italian 
  /did -a Translater_dialog 4 English 
  /did -a Translater_dialog 1 French 
  /did -a Translater_dialog 1 Spanish 
  /did -a Translater_dialog 1 German 
  /did -a Translater_dialog 1 Italian 
  /did -a Translater_dialog 1 English 
} 

alias translate { /dialog -ma Translater_dialog Translater_dialog } 

on *:DIALOG:Translater_dialog:edit:8:{ /set %translate-text $replace($did(8),$chr(32),$+(%,2,0)) } 

on *:DIALOG:Translater_dialog:close:*:{ translate-text } 

dialog Translater_dialog { 
  title "Translater_dialog" 
  size -1 -1 188 141 
  option dbu 
  list 1, 124 28 50 50, sort size 
  button "Translate", 2, 12 123 78 12, ok 
  button "Cancel", 3, 99 123 75 12, cancel 
  list 4, 58 28 50 50, sort size 
  text "Translate from?", 5, 60 19 45 8 
  text "Translate too?", 6, 128 20 42 8 
  box "Translater", 7, 5 5 181 133 
  edit "", 8, 36 97 50 10, autohs 
  box "Text To Translate", 9, 24 88 72 26 
  box "Languges", 10, 55 11 129 70 
  text "Welcome to the translater dialog please select a languge to translate from and a languge to translate too then enter your text to translate.", 11, 10 22 42 58 
} 

alias -l translate-text { 
  sockopen lang ets.freetranslation.com 80 
} 
on *:SOCKOPEN:lang:{ 
  sockwrite -n $sockname GET /?srcText= $+ %translate-text $+ &mode=html&template=results_en-us.htm&sequence=core&language= $+ %translate-from $+ $+(%,2,F) $+ %translate-too HTTP/1.1 
  sockwrite -n $sockname Host: ets.freetranslation.com $+ $crlf $+ $crlf 
} 
on *:SOCKREAD:lang:{ 
  if ($sockerr) { /echo -a Sorry $nick There was a problem connecting to the site, try again soon. | { /halt } } 
  else { 
    var %outcome-looks-? 
    sockread -f %outcome-looks-? 
    if (*textarea name="dsttext" cols="40" rows="6"* iswm %outcome-looks-?) { /dialog -ma Translater_Dialog_ Translater_Dialog_ | /did -a Translater_dialog_ 1 $html-just-ditch-it($remove(%outcome-looks-?,$chr(9))) | /unset %translate* %%outcome-looks-? | { /halt } } 
    if ($sockerr) { /echo -a Sorry $nick There was a problem connecting to the site, try again soon. } 
  } 
} 

alias -l html-just-ditch-it { 
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) 
  return %x 
} 

dialog Translater_Dialog_ { 
  title "Translater Dialog" 
  size -1 -1 169 88 
  option dbu 
  text "Here is the Translated text you wanted.", 2, 17 16 144 16 
  box "Finished", 3, 8 5 157 79 
  button "Close", 4, 13 69 74 12, cancel 
  button "Translate something else", 5, 91 69 67 12, ok 
  combo 1, 18 34 132 34, size 
} 

on *:DIALOG:Translater_Dialog_:sclick:5:{ /.timer 1 1 /dialog -ma Translater_Dialog Translater_Dialog 
}

Comments

Sign in to comment.
Jordyboy   -  Dec 29, 2008

Thanks for the comments
@Pwnisher - That would be the socket

Going to start updating this script hopefully.

 Respond  
pwnisher3   -  Dec 07, 2008

hmm. it is really good. but it has a lil bit of wrong translations. i translated i love you from english to german. it said "ich lieba sie" and it is "ich lieba d|ck" :P (lol it says d|ck, but it is not pronounced that :D)

 Respond  
M[n]M   -  Dec 13, 2007

Yo i love this scrtip man !! i\'ll give you 10 points for that Thanks for makin\' it!

 Respond  
guest598594   -  Oct 01, 2007
echo -a Sorry $nick There was a problem connecting to the site, try again soon.

should be $me not $nick

 Respond  
guest598594   -  Jul 03, 2007

This is an awesome snippet! However, it\'s to, not too.

 Respond  
Lindrian   -  Feb 10, 2007

Havent tried it, will do later, but I can tell you, remove all the /.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.