From 7bf6347b1b3f904ef98de88e1287163656bd82e7 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Mon, 18 Apr 2011 22:31:14 +0200 Subject: [PATCH] simple translate using Google translate --- bin/translate | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/translate diff --git a/bin/translate b/bin/translate new file mode 100755 index 0000000..09a73a8 --- /dev/null +++ b/bin/translate @@ -0,0 +1,8 @@ +#!/bin/sh +# +# translate using google Translate services +# +# Usage: +# translate "la vie des chicons" fr en + +wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/';