Mercurial > repo
view bin/translatefromto @ 3630:738fd1a0b660
<oerjan> addquote <elliott> my contract states right here that I have to tell you the best version of python is called haskell 2010
author | HackBot |
---|---|
date | Wed, 04 Sep 2013 01:24:47 +0000 |
parents | e037173e0012 |
children | 30212f437ffe |
line wrap: on
line source
#!/bin/bash TEXT="$1" FROM=`echo "$TEXT" | sed 's/ .*$//'` TEXT=`echo "$TEXT" | sed 's/^[^ ]* //'` TO=`echo "$TEXT" | sed 's/ .*$//'` TEXT=`echo "$TEXT" | sed 's/^[^ ]* //'` if [ "$FROM" = "auto" ] ; then FROM="" ; fi curl -e http://codu.org/ http://ajax.googleapis.com/ajax/services/language/translate \ --data-urlencode v=1.0 \ --data-urlencode q="$TEXT" \ --data-urlencode langpair="$FROM"'|'"$TO" 2> /dev/null | json 'data["responseData"]["translatedText"]'