aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjoshua-redfield <joshua.redfield@gmail.com>2012-01-23 17:10:26 -0500
committerjoshua-redfield <joshua.redfield@gmail.com>2012-01-23 17:10:26 -0500
commit20c76051779581645b2edb4b9250150d2a44135d (patch)
tree8425423b250deefb21f22f24bc017e38d071a603
parentbd2b6a3cfa8d9a8a7ae5308ad18fd6917a82bd03 (diff)
downloadlauf-20c76051779581645b2edb4b9250150d2a44135d.tar.gz
lauf-20c76051779581645b2edb4b9250150d2a44135d.tar.xz
lauf-20c76051779581645b2edb4b9250150d2a44135d.zip
Translate plugin removed, Google Tanslate API was removed :(testing
-rwxr-xr-xplugins/translate.sh46
1 files changed, 0 insertions, 46 deletions
diff --git a/plugins/translate.sh b/plugins/translate.sh
deleted file mode 100755
index 7b265fc..0000000
--- a/plugins/translate.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-########################################################
-# translate v0.1.0 #
-# (c) 2010 joshua.redfield(AT)gmail.com #
-# Summary: #
-# Use google translate service to translate words or phrased into a different language #######################
-# Usage: #
-# translate LANGUAGE to LANGUAGE PHRASE or translate #
-# Dependencies: #
-# curl, sed, xclip(optional) #################################################
-########################################################
-# Functions #
-#############
-google_translate () {
- translate=$(curl -s -A 'Mozilla/4.0' "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$translate_text&langpair=${lauf_exec2}|${lauf_exec4}" | \
-sed -E -n 's/[[:alnum:]": {}]+"translatedText":"([^"]+)".*/\1/p';)
- lauf_notify "Google Translate: $translate_text_first" "$translate"
- if type "xclip" >/dev/null; then
- echo "$translate" | tr -d '\n' | xclip -selection clipboard
- fi
- return
-}
-########################################################
-# Arguements for skipping GUI #
-########################################################
-if [ ! ${lauf_exec2:=unset} = "unset" ] && [ ! ${lauf_exec2:="unset"} = "unset" ] && [ ${lauf_exec3:="unset"} = "to" ] && [ ! ${lauf_exec4:="unset"} = "unset" ] && [ ! ${lauf_exec5:="unset"} = "unset" ]; then
- translate_text_first=${lauf_exec#"$lauf_exec1 $lauf_exec2 $lauf_exec3 $lauf_exec4 "}
- translate_text=$(echo $translate_text_first | tr -s ' ' '+') #Change spaces into plus signs
- google_translate
- return
-fi
-########################################################
-# GUI Code #
-########################################################
-google_translate=$(zenity --entry --width=${lauf_width} --window-icon=$lauf_app_icon --title="${lauf_app_name}" --text="What word or phrase are you trying to translate $_master?")
-case $? in
- 0)
- lauf_exec2=$(zenity --entry --width=${lauf_width} --window-icon=$lauf_app_icon --title="${lauf_app_name}" --text="What language are you translating from $_master?")
- lauf_exec4=$(zenity --entry --width=${lauf_width} --window-icon=$lauf_app_icon --title="${lauf_app_name}" --text="What language are you translating to $_master?")
- translate_text=$(echo $google_translate | tr -s ' ' '+') #Change spaces into plus signs
- translate_text_first=$google_translate
- google_translate
- ;;
- *)
- lauf_cancel
- ;;
-esac