#!/bin/sh

	msgbox title="Leo-~Ubersetzer" msg="~cBitte Ursprungssprache ausw~ahlen." select="Abbruch,Englisch,Franz~osisch" default=2 timeout=20
	lng=$?
	if [ $lng -gt 1 ] ; then
		case "$lng" in
		2)
			lang="ende"
			ask="englisches"
			;;
		3)
			lang="frde"
			ask="franz~osisches"
		esac

		word="_"		
		until [ ! $word ]; do
			word=`input t='Bitte zu ~ubersetzendes '$ask' Wort eingeben:' l='@@@@@@@@@@@@@@@@@@@@@@@@@' k=1 d=$word`
			if [ $word ] ; then
				wget -O /tmp/pdaleo.tmp 'http://pda.leo.org/?lp='$lang'&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=on&spellToler=std&search='$word
				sed -e s/'\&nbsp;'/''/g -e s/'<\/td>'/'\n'/g -e s/'<\n\n>'/'\n'/g -e s/'<B>'/'~G'/g -e s/'<\/B>'/'~S'/g -e s/'\&reg;'/''/g /tmp/pdaleo.tmp > /tmp/pdaleo.html
				/var/plugins/tuxwet/tuxwetter "TXTHTML=Deutsche ~Ubersetzung f~ur ~G$word,http://localhost/../../../tmp/pdaleo.html|Treffer|</table>"
				rm /tmp/pdaleo.*
			fi
		done
	fi
