shithub: sirjofri_de

ref: 88ab2978b63f3de29994685a168a1606b8b62e28
dir: /pub/files/9front/rc/trans/

View raw version
#!/bin/rc

if(! ~ $#* 2)
	exit 'usage'

sourcelang=$*(1)
targetlang=$*(2)

text=`{cat}
send=`{echo $"text | urlencode}

hget 'https://translate.googleapis.com/translate_a/single?client=gtx&sl='^$sourcelang^'&tl='^$targetlang^'&dt=t&q='^$"send | sed 1q | sed 's/^\[\[\["//;s/\",\".*$//g'