--- translate-0.6.orig/translate.conf +++ translate-0.6/translate.conf @@ -1,4 +1,4 @@ -LANG=de-en +LANGUAGE=de-en GLOBDIR=/usr/share/trans DONT_ASK=false -INVERS=false \ No newline at end of file +INVERS=false --- translate-0.6.orig/Makefile +++ translate-0.6/Makefile @@ -1,14 +1,10 @@ install: - install -d debian/tmp/usr/bin - cp translate debian/tmp/usr/bin - install -d debian/tmp/etc - cp translate.conf debian/tmp/etc - install -d debian/tmp/usr/share/doc + install -d $(DESTDIR)/usr/bin + cp translate $(DESTDIR)/usr/bin + install -d $(DESTDIR)/etc + cp translate.conf $(DESTDIR)/etc + install -d $(DESTDIR)/usr/share/doc # gzip -9 -c debian/changelog > debian/tmp/usr/share/doc/changelog.Debian.gz clean: rm -f *~ - - - - --- translate-0.6.orig/translate +++ translate-0.6/translate @@ -26,7 +26,7 @@ GLOBDIR=/usr/share/trans GLOBALCONF=/etc/translate.conf LOCALCONF=$LOCDIR/translate.conf -LANG=de-en +LANGUAGE=de-en WHOLEWORD=false DONT_ASK=false INVERS=false @@ -46,13 +46,13 @@ OPTIONS: -n non-interactive (don't prompt if no matches found) - -i invers lookup (from second to first language) + -i inverse lookup (from second to first language) -w search only complete words -l languages to translate between -v display version and exit -h display this message -EXAMPLE: `basename $0` -l de-en simplest +EXAMPLE: `basename $0` -l de-en -i simplest " } @@ -76,12 +76,24 @@ fi } -# If there is no $LOCDIR we should create one -if [ ! -d $LOCDIR ] - then - echo -n "creating private folder $LOCDIR... " - mkdir $LOCDIR && echo "OK." -fi +display () +{ + if [ "$2" = "-n" ]; then + OPT="-n" + fi + if [ $UTF8 -eq 1 ]; then + echo $OPT "$1" + else + echo $OPT "$1" | iconv -f UTF-8 -t $CHARSET + fi +} + +# Don't create $LOCDIR automatically to prevent homedir polution +#if [ ! -d $LOCDIR ] +# then +# echo -n "creating private folder $LOCDIR... " +# mkdir $LOCDIR && echo "OK." +#fi # Read configuration file, if any if [ -r $GLOBALCONF ] @@ -104,7 +116,7 @@ -h) usage; exit 0 ;; -n) DONT_ASK=true; shift;; -i) invert_lang; shift;; - -l) LANG=$2; shift; shift;; + -l) LANGUAGE=$2; shift; shift;; --) shift; break;; esac done @@ -115,58 +127,79 @@ fi # Finally we should know what language to use -GLOBDIC=$GLOBDIR/$LANG -LOCDIC=$LOCDIR/$LANG +GLOBDIC=$GLOBDIR/$LANGUAGE +LOCDIC=$LOCDIR/$LANGUAGE # Is there already a global dictionary for these languages # or should we rely on our own, private one? if [ -r $GLOBDIC ] then - DIC="$GLOBDIC $LOCDIC" + if [ -r $LOCDIC ] + then + DIC="$GLOBDIC $LOCDIC" + else + DIC="$GLOBDIC" + fi else -echo "$GLOBDIC nicht richtig" + echo "`basename $0`: Global dictionary $GLOBDIC does not exist or is not readable!" if [ -r $LOCDIC ] then + echo "`basename $0`: Fallback to $LOCDIC" DIC=$LOCDIC - echo "`basename $0`: Global dictionary $GLOBDIC does not exist or is not readable!" -echo "`basename $0`: Fallback to $LOCDIC " - echo "" + else + echo "`basename $0`: Fallback to $LOCDIC is not posible." + echo "No dictionaries exist!" + exit 0 fi fi -# now get the real work done -if +if [ ! "$CHARSET" ] ; then + # ISO-8859-1 is just an assumption (a bad one) but I've no idea how to + # find out the appropriate charmap. This way, please can at least + # overwrite it through their configuration files. + CHARSET="ISO-8859-1" +fi +UTF8=0 +if locale 2>&1 | grep -E -q "UTF-8?$"; then + UTF8=1 +fi +SEARCH=$* +[ $UTF8 -eq 0 ] && SEARCH=$(echo "$SEARCH" | iconv -f $CHARSET -t UTF-8) +# now get the real work done +if [ 1 ] ; then if [ $WHOLEWORD = false ] then if [ $INVERS = false ] then - egrep -ihs "$*".*' :: ' $DIC + result=$(egrep -ihs "$SEARCH".*' :: ' $DIC) else - egrep -ihs ' :: '.*"$*" $DIC + result=$(egrep -ihs ' :: '.*"$SEARCH" $DIC) fi else if [ $INVERS = false ] then - egrep -wihs "$*".*' :: ' $DIC + result=$(egrep -ihs '\b'"$SEARCH"'\b'.*' :: ' $DIC) else - egrep -wihs ' :: '.*"$*" $DIC + result=$(egrep -ihs ' :: '.*'\b'"$SEARCH"'\b' $DIC) fi fi +fi -then # Done +if [ "$result" ]; then + display "$result" exit 0 else # Fallback to human intelligence (unless "-n" is present) if [ $DONT_ASK = true ] then - echo "Sorry \"$*\" not found" + display "Sorry \"$SEARCH\" not found" else echo "No matches. Teach me or press Return." - echo -n "$* :: " + display "$SEARCH :: " -n read NEW_ENTRY if [ -z "$NEW_ENTRY" ] then # User is lazy @@ -174,10 +207,11 @@ else # We've got a new entry if [ $INVERS = false ] + # FIXME: handle UTF-8 (?) then - echo "$* :: $NEW_ENTRY" >> $LOCDIC + echo "$SEARCH :: $NEW_ENTRY" >> $LOCDIC else - echo "$NEW_ENTRY :: $*" >> $LOCDIC + echo "$NEW_ENTRY :: $SEARCH" >> $LOCDIC fi exit 0 fi --- translate-0.6.orig/debian/control +++ translate-0.6/debian/control @@ -0,0 +1,15 @@ +Source: translate +Section: text +Priority: optional +Maintainer: Anibal Monsalve Salazar +Build-Depends: debhelper (>= 7) +Standards-Version: 3.8.4 + +Package: translate +Architecture: all +Depends: ${misc:Depends}, trans-de-en (>= 1.4-1) +Suggests: xtranslate +Description: translates words from English into German or viceversa + It looks up a word in a file with language-to-language translations + (field separator should be \" :: \") and maintains local dictionaries. + So it should be easy to add more languages, if you have such a dictionary. --- translate-0.6.orig/debian/README.debian +++ translate-0.6/debian/README.debian @@ -0,0 +1,10 @@ +translate for DEBIAN +---------------------- + + * Added option "-w" , which searches only whole words + * Fixed a bug with inverting languages + * Changed the default directories + * Added a manpage + + +Matthias Kabel , Sun, 7 Oct 2001 18:15:12 +0200 --- translate-0.6.orig/debian/compat +++ translate-0.6/debian/compat @@ -0,0 +1 @@ +7 --- translate-0.6.orig/debian/rules +++ translate-0.6/debian/rules @@ -0,0 +1,62 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + #$(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/translate. + $(MAKE) DESTDIR=$(CURDIR)/debian/translate install + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman debian/translate.1 + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- translate-0.6.orig/debian/translate.1 +++ translate-0.6/debian/translate.1 @@ -0,0 +1,52 @@ +.TH TRANSLATE 1 +.SH NAME +translate \- looks up for words in a dictionary +.SH SYNOPSIS +.B translate +.I "[options] words" +.SH "DESCRIPTION" +translate looks up for words in a dictionary and translates them. +It can handle multiple dictionaries and charsets. +It comes with an english-german dictionary and is able to translate in both +directions. + +.PP +.SH OPTIONS +.TP +.B \-n +non-interactive (don't prompt if no matches found) +.TP +.B \-i +invers lookup (from second to first language) +.TP +.B \-l +languages to translate between +.TP +.B \-v +display version and exit +.TP +.B \-w +searches only whole words +.TP +.B -h display help + +.SH EXAMPLE +.TP +translate -l en-de simplest + +.SH "SEE ALSO" +xtranslate + +.SH FILES +translate preferred language and is stored in +/etc/translate.conf +You can store your private configuration file in ~/.translate. +If there are no options in +the commandline it uses the default values de-en. + +It can also create a private dictionary in ~/.translate + +.SH AUTHOR +Jochem Huhmann wrote translate. This manual page +was written for the Debian GNU/Linux system (but may be used by +others). --- translate-0.6.orig/debian/copyright +++ translate-0.6/debian/copyright @@ -0,0 +1,33 @@ +This package is currently maintained by +Anibal Monsalve Salazar + +It was created by Matthias Kabel on +Sun, 23 May 1999 16:06:34 +0200. + +It was downloaded from: + + +Copyright: Jochem Huhmann + +There are some changes against the original version, so with permission of +Jochem Huhmann the version number was upgraded to 0.6 + +# translate -- script for translating words +# V0.5: Copyright(C) 1998 by Jochem Huhmann +# +# translate is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# translate is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with XEmacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301, USA. + +For the text of the GPL see /usr/share/common-licenses/GPL-2 --- translate-0.6.orig/debian/dirs +++ translate-0.6/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/man/man1 +etc --- translate-0.6.orig/debian/changelog +++ translate-0.6/debian/changelog @@ -0,0 +1,112 @@ +translate (0.6-11) unstable; urgency=low + + * DH compatibility level is 7 + * Fix debhelper-but-no-misc-depends + * Fix dh-clean-k-is-deprecated + * Fix out-of-date-standards-version + * Fix copyright-refers-to-versionless-license-file + * Fix manpage-has-bad-whatis-entry + + -- Anibal Monsalve Salazar Wed, 10 Feb 2010 09:50:07 +1100 + +translate (0.6-10) unstable; urgency=low + + * Don't depend on debmake, run dh_make. Closes: #460648 + * Bumped Standards-Version to 3.7.3 + + -- Anibal Monsalve Salazar Wed, 16 Jan 2008 19:04:00 +1100 + +translate (0.6-9) unstable; urgency=low + + * Set Standards-Version to 3.7.2. + + -- Anibal Monsalve Salazar Sun, 25 Jun 2006 17:24:56 +1000 + +translate (0.6-8) unstable; urgency=low + + * Fixed "should be 'arch: all'", closes: #357308. + + -- Anibal Monsalve Salazar Fri, 17 Mar 2006 09:15:21 +1100 + +translate (0.6-7) unstable; urgency=low + + * Fixed "utf8 encodes utf8 lines again" (again) and "iconv + problems in u8 locale", closes: #314158, #318986. Patch by + Martin Michlmayr . + * translate.conf: changed "LANG" to "LANGUAGE". + * Fixed "do not create an empty local configuration directory at + ~/.translate", closes: #327004. Patch by Jonas Meurer . + * Set Standards-Version to 3.6.2. + * Fixed FSF mail address. + + -- Anibal Monsalve Salazar Tue, 29 Nov 2005 23:12:21 +1100 + +translate (0.6-6) unstable; urgency=low + + * Fixed "utf8 encodes utf8 lines again", closes: #313362. + Patch by Martin Michlmayr . + + -- Anibal Monsalve Salazar Wed, 15 Jun 2005 09:04:28 +1000 + +translate (0.6-5) unstable; urgency=low + + * Fixed "translate: does not understand locales and UTF-8", + closes: #219199. Patch by Martin Michlmayr . + * Fixed "fix logic of global and local dictionary check", + closes: #307581. Patch by Martin Michlmayr . + * Fixed "please don't create ~/.translate when it's not needed", + closes: #307582. Patch by Martin Michlmayr . + + -- Anibal Monsalve Salazar Sun, 15 May 2005 19:58:03 +1000 + +translate (0.6-4) unstable; urgency=low + + * New maintainer's email address. + + -- Anibal Monsalve Salazar Sat, 12 Feb 2005 19:52:16 +1100 + +translate (0.6-3) unstable; urgency=low + + * New maintainer. Closes: #244203 + * New Option -w doesn't work as expected. Closes: #116100 + Patch by Christian Kurz + * Says "No matches. Teach me or press Return." even if there are matches. Closes: #182472, #241198 + Patch by Georg Neis + Patch by gerhard oettl + * Spelling error in description. Closes: #125431 + Patch by Matt Zimmerman . + * Example in synopsis doesn't work. Closes: #193733 + * Cruft in debian. Bug already fixed. Closes: #82789 + + -- Anibal Monsalve Salazar Wed, 18 Aug 2004 21:59:42 +1000 + +translate (0.6-2) unstable; urgency=low + + * Fixed build-deps, and a wrong gzip in Makefile closes: Bug #114880 + + -- Matthias Kabel Mon, 8 Oct 2001 22:43:22 +0200 + +translate (0.6-1) unstable; urgency=low + + * New option -w which searches only whole words, closes: Bug #114559 + + -- Matthias Kabel Sun, 7 Oct 2001 18:53:32 +0200 + +translate (0.5-9) unstable; urgency=low + + * tried to remember the ancient changes closes: Bug #82790 + + -- Matthias Kabel Sun, 26 Aug 2001 11:44:06 +0200 + +translate (0.5-8) unstable; urgency=low + + * fixed a bug with inverting languages + Thanks to Wolfgang Jahrling + + -- Matthias Kabel Sat, 30 Dec 2000 20:13:08 +0200 + +translate (0.5-7) unstable; urgency=low + + * changed the configuration files + + -- Matthias Kabel Fri, 13 Dec 2000 17:19:13 +0200