tazpkg rev 344

Gettextize tazpkg
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jun 20 17:23:34 2010 +0200 (2010-06-20)
parents d6183a5cf8c4
children c0b11abd0df1
files Makefile README tazpkg
line diff
     1.1 --- a/Makefile	Sun Jun 20 11:52:56 2010 +0200
     1.2 +++ b/Makefile	Sun Jun 20 17:23:34 2010 +0200
     1.3 @@ -12,7 +12,7 @@
     1.4  # i18n.
     1.5  
     1.6  pot:
     1.7 -	xgettext -o po/tazpkg/tazpkg.pot -L Shell ./tazpkg
     1.8 +	xgettext -o po/tazpkg/tazpkg.pot -L Shell --package-name=Tazpkg ./tazpkg
     1.9  	
    1.10  msgmerge:
    1.11  	@for l in $(LINGUAS); do \
     2.1 --- a/README	Sun Jun 20 11:52:56 2010 +0200
     2.2 +++ b/README	Sun Jun 20 17:23:34 2010 +0200
     2.3 @@ -11,6 +11,8 @@
     2.4  Bash, it runs under Ash - part of the Busybox project. Tazpkg is distributed
     2.5  under the free GNU license GPL V3. 
     2.6  
     2.7 +Developement HG repo: http://hg.slitaz.org/tazpkg
     2.8 +
     2.9  
    2.10  Installation
    2.11  ------------
     3.1 --- a/tazpkg	Sun Jun 20 11:52:56 2010 +0200
     3.2 +++ b/tazpkg	Sun Jun 20 17:23:34 2010 +0200
     3.3 @@ -6,7 +6,10 @@
     3.4  # list, install, remove, download or get information about a package. You can
     3.5  # use 'tazpkg usage' to get a list of commands with short descriptions. Tazpkg
     3.6  # also resolves dependencies and can upgrade packages from a mirror. I18n is
     3.7 -# done with gettext: `gettext "displayed text"`
     3.8 +# done with gettext and eval_gettext, ex:
     3.9 +# 	gettext "displayed text"; echo
    3.10 +# 	eval_gettext "display \$VARIABLE"; echo
    3.11 +# 	echo -e "BOLD `gettext \"i18n message\"`"
    3.12  #
    3.13  # (C) 2007-2010 SliTaz - GNU General Public License v3.
    3.14  #
    3.15 @@ -52,28 +55,6 @@
    3.16  BLOCKED=$LOCALSTATE/blocked-packages.list
    3.17  DEFAULT_MIRROR="http://mirror.slitaz.org/packages/`cat /etc/slitaz-release`/"
    3.18  
    3.19 -# Messages language setting --> line 230.
    3.20 -case $LANG in
    3.21 -	fr*)
    3.22 -		#. /usr/share/slitaz/messages/fr/tazpkg.msg
    3.23 -		# Bold red warning for upgrade.
    3.24 -		WARNING="\\033[1;31mATTENTION\\033[0;39m"
    3.25 -		CHECK_FOR_PACKAGE_FILE_MSG="Impossible de trouver"
    3.26 -		CHECK_FOR_RECEIPT_MSG="Impossible de trouver la receipt"
    3.27 -		CHECK_FOR_INSTALLED_PACKAGE_MSG="\
    3.28 -$PACKAGE est déjà installé. Vous pouvez utiliser l'option --forced pour
    3.29 -forcer l'installation ou supprimer le paquet et le réinstaller." ;;
    3.30 -	*)
    3.31 -		#. /usr/share/slitaz/messages/en/tazpkg.msg
    3.32 -		# Bold red warning for upgrade.
    3.33 -		WARNING="\\033[1;31mWARNING\\033[0;39m"
    3.34 -		CHECK_FOR_PACKAGE_FILE_MSG="Unable to find"
    3.35 -		CHECK_FOR_RECEIPT_MSG="Unable to find the receipt"
    3.36 -		CHECK_FOR_INSTALLED_PACKAGE_MSG="\
    3.37 -$PACKAGE is already installed. You can use the --forced option to force
    3.38 -installation or remove it and reinstall." ;;
    3.39 -esac
    3.40 -
    3.41  # Check if the directories and files used by Tazpkg
    3.42  # exist. If not and user is root we create them.
    3.43  if test $(id -u) = 0 ; then
    3.44 @@ -161,9 +142,10 @@
    3.45  check_root()
    3.46  {
    3.47  	if test $(id -u) != 0 ; then
    3.48 -		echo -e "\nYou must be root to run `basename $0` with this option."
    3.49 -		echo -e "Please use 'su' and root password to become super-user.\n"
    3.50 -		exit 0
    3.51 +		gettext \
    3.52 +"You must be root to run tazpkg with this option. Please use the command:
    3.53 +su followed by the root password to become super-user."; echo
    3.54 +		echo "" && exit 0
    3.55  	fi
    3.56  }
    3.57  
    3.58 @@ -171,7 +153,9 @@
    3.59  check_for_package_on_cmdline()
    3.60  {
    3.61  	if [ -z "$PACKAGE" ]; then
    3.62 -		echo -e "\nPlease specify a package name on the command line.\n"
    3.63 +		echo "" 
    3.64 +		gettext "Please specify a package name on the command line."; echo
    3.65 +		echo ""
    3.66  		exit 0
    3.67  	fi
    3.68  }
    3.69 @@ -180,9 +164,9 @@
    3.70  check_for_package_file()
    3.71  {
    3.72  	if [ ! -f "$PACKAGE_FILE" ]; then
    3.73 -		echo -e "
    3.74 -$CHECK_FOR_PACKAGE_FILE_MSG : $PACKAGE_FILE\n"
    3.75 -		exit 0
    3.76 +		echo ""
    3.77 +		eval_gettext "Unable to find: \$PACKAGE_FILE"; echo
    3.78 +		echo "" && exit 0
    3.79  	fi
    3.80  }
    3.81  
    3.82 @@ -190,8 +174,10 @@
    3.83  check_for_receipt()
    3.84  {
    3.85  	if [ ! -f "$1$INSTALLED/$PACKAGE/receipt" ]; then
    3.86 -		echo -e "\n$CHECK_FOR_RECEIPT_MSG : $1$INSTALLED/$PACKAGE/receipt\n"
    3.87 -		exit 0
    3.88 +		FS=$1
    3.89 +		echo ""
    3.90 +		eval_gettext "Unable to find the receipt: \$FS\$INSTALLED/\$PACKAGE/receipt"; echo
    3.91 +		echo "" && exit 0
    3.92  	fi
    3.93  }
    3.94  
    3.95 @@ -220,8 +206,10 @@
    3.96  check_for_installed_package()
    3.97  {
    3.98  	if [ -n "$(get_installed_package_pathname $PACKAGE $1)" ]; then
    3.99 -		echo -e "\n$CHECK_FOR_INSTALLED_PACKAGE_MSG\n"
   3.100 -		exit 0
   3.101 +		echo ""
   3.102 +		eval_gettext "\$PACKAGE package is already installed. You can
   3.103 +use the --forced option to force installation or remove it and reinstall."; echo
   3.104 +		echo "" && exit 0
   3.105  	fi
   3.106  }
   3.107  
   3.108 @@ -232,10 +220,12 @@
   3.109  		if test $(id -u) = 0 ; then
   3.110  			tazpkg recharge
   3.111  		else
   3.112 -			echo -e "\nUnable to find the list : $LOCALSTATE/packages.list\n
   3.113 -You should probably run 'tazpkg recharge' as root to get the latest list of
   3.114 -packages available on the mirror.\n"
   3.115 -			exit 0
   3.116 +			echo ""
   3.117 +			eval_gettext "Unable to find the list: \$LOCALSTATE/packages.list"; echo
   3.118 +			gettext \
   3.119 +"You must probably run 'tazpkg recharge' as root to get the latest list of
   3.120 +packages available on the mirror."; echo
   3.121 +			echo "" && exit 0
   3.122  		fi
   3.123  	fi
   3.124  }
   3.125 @@ -327,7 +317,9 @@
   3.126  	if [ -n "$filename" ]; then
   3.127  		PACKAGE=$filename
   3.128  	else
   3.129 -		echo -e "\nUnable to find : $PACKAGE in the mirrored packages list.\n"
   3.130 +		echo ""
   3.131 +		eval_gettext "Unable to find: \$PACKAGE in the mirrored packages list."; echo
   3.132 +		echo ""
   3.133  		[ -n "$check_only" ] && return 1
   3.134  		exit 0
   3.135  	fi
   3.136 @@ -379,9 +371,9 @@
   3.137  # Extract a package with cpio and gzip/lzma.
   3.138  extract_package()
   3.139  {
   3.140 -	echo -n "Extracting $PACKAGE... "
   3.141 +	gettext "Extracting $PACKAGE... "
   3.142  	cpio -idm < $PACKAGE.tazpkg && rm -f $PACKAGE.tazpkg
   3.143 -	echo -n "Extracting the pseudo fs... "
   3.144 +	gettext "Extracting the pseudo fs... "
   3.145  	if [ -f fs.cpio.lzma ]; then
   3.146  		echo -n "(lzma) "
   3.147  		unlzma -c fs.cpio.lzma | cpio -idm && rm fs.cpio.lzma
   3.148 @@ -440,9 +432,9 @@
   3.149  	mkdir -p $TMP_DIR
   3.150  	[ -n "$INSTALL_LIST" ] && echo "$PACKAGE_FILE" >> $INSTALL_LIST-processed
   3.151  	echo ""
   3.152 -	echo -e "\033[1mInstallation of :\033[0m $PACKAGE"
   3.153 +	echo -e "\033[1m`gettext \"Installation of :\"`\033[0m $PACKAGE"
   3.154  	echo "================================================================================"
   3.155 -	echo -n "Copying $PACKAGE... "
   3.156 +	eval_gettext "Copying \$PACKAGE... "
   3.157  	cp $PACKAGE_FILE $TMP_DIR
   3.158  	status
   3.159  	cd $TMP_DIR
   3.160 @@ -454,10 +446,10 @@
   3.161  	. $PWD/receipt
   3.162  	cd $ROOT$INSTALLED
   3.163  	if [ $SELF_INSTALL -ne 0 -a -n "$ROOT" ]; then
   3.164 -		echo -n "Checking post install dependencies... "
   3.165 +		gettext "Checking post install dependencies... "
   3.166  		[ -f $INSTALLED/$PACKAGE/receipt ]
   3.167  		if ! status; then
   3.168 -			echo "Please run 'tazpkg install $PACKAGE_FILE' in / and retry."
   3.169 +			eval_gettext "Please run 'tazpkg install \$PACKAGE_FILE' in / and retry."; echo
   3.170  			rm -rf $TMP_DIR
   3.171  			exit 1
   3.172  		fi
   3.173 @@ -531,7 +523,7 @@
   3.174  	fi
   3.175  	if [ -n "$CONFIG_FILES" ]; then
   3.176  		# save 'official' configuration files
   3.177 -		echo -n "Saving configuration files for $PACKAGE... "
   3.178 +		eval_gettext "Saving configuration files for \$PACKAGE... "
   3.179  		for i in $CONFIG_FILES; do
   3.180  			( cd fs ; find ${i#/} -type f )
   3.181  		done | ( cd fs ; cpio -o -H newc | gzip -9 ) > \
   3.182 @@ -545,11 +537,11 @@
   3.183  		done
   3.184  		status
   3.185  	fi
   3.186 -	echo -n "Installing $PACKAGE... "
   3.187 +	eval_gettext "Installing \$PACKAGE... "
   3.188  	cp -a fs/* $ROOT/
   3.189  	status
   3.190  	if [ -s files2remove.list ]; then
   3.191 -		echo -n "Removing old $PACKAGE... "
   3.192 +		eval_gettext "Removing old \$PACKAGE... "
   3.193  		while read file; do
   3.194  			remove_with_path $ROOT$file
   3.195  		done < files2remove.list
   3.196 @@ -557,7 +549,7 @@
   3.197  		status
   3.198  	fi
   3.199  	# Remove the temporary random directory.
   3.200 -	echo -n "Removing all tmp files... "
   3.201 +	gettext "Removing all tmp files... "
   3.202  	cd .. && rm -rf $TMP_DIR
   3.203  	status
   3.204  	# Post install commands.
   3.205 @@ -566,7 +558,7 @@
   3.206  	fi
   3.207  	cd $TOP_DIR
   3.208  	echo "================================================================================"
   3.209 -	echo "$PACKAGE ($VERSION$EXTRAVERSION) is installed."
   3.210 +	eval_gettext "\$PACKAGE (\$VERSION\$EXTRAVERSION) is installed."; echo
   3.211  	echo ""
   3.212  	# Log this activity
   3.213  	[ -n "$ROOT" ] || log Installed
   3.214 @@ -617,22 +609,22 @@
   3.215  			MISSING_PACKAGE=$i
   3.216  			deps=$(($deps+1))
   3.217  		elif [ ! -f "$1$INSTALLED/$i/receipt" ]; then
   3.218 -			echo -e "$WARNING Dependency loop between $PACKAGE and $i."
   3.219 +			eval_gettext "WARNING Dependency loop between \$PACKAGE and \$i."; echo
   3.220  		fi
   3.221  	done
   3.222  	if [ ! "$MISSING_PACKAGE" = "" ]; then
   3.223 -		echo -e "\033[1mTracking dependencies for :\033[0m $PACKAGE"
   3.224 +		echo -e "\033[1m`gettext \"Tracking dependencies for :\"`\033[0m $PACKAGE"
   3.225  		echo "================================================================================"
   3.226  		for pkgorg in $DEPENDS
   3.227  		do
   3.228  			i=$(equivalent_pkg $pkgorg $1)
   3.229  			if [ ! -d "$1$INSTALLED/$i" ]; then
   3.230  				MISSING_PACKAGE=$i
   3.231 -				echo "Missing : $MISSING_PACKAGE"
   3.232 +				eval_gettext "Missing: \$MISSING_PACKAGE"; echo
   3.233  			fi
   3.234  		done
   3.235  		echo "================================================================================"
   3.236 -		echo "$deps missing package(s) to install."
   3.237 +		eval_gettext "\$deps missing package(s) to install."; echo
   3.238  	fi
   3.239  }
   3.240  
   3.241 @@ -648,7 +640,7 @@
   3.242  		anser="y"
   3.243  	else
   3.244  		echo ""
   3.245 -		echo -n "Install all missing dependencies (y/N) ? "; read anser
   3.246 +		gettext "Install all missing dependencies (y/N) ? "; read anser
   3.247  		echo ""
   3.248  	fi
   3.249  	if [ "$anser" == "y" ]; then
   3.250 @@ -663,7 +655,7 @@
   3.251  				# the TAZPKG_BASENAME in the local packages.list.
   3.252  				found=0
   3.253  				if [ -f "$list" ]; then
   3.254 -					echo "Checking if $pkg exists in local list... "
   3.255 +					eval_gettext "Checking if \$pkg exists in local list... "; echo
   3.256  					mkdir $TMP_DIR
   3.257  					for i in $pkg-*.tazpkg; do
   3.258  						[ -f $i ] || continue
   3.259 @@ -688,8 +680,11 @@
   3.260  			fi
   3.261  		done
   3.262  	else
   3.263 -		echo -e "\nLeaving dependencies for $PACKAGE unsolved."
   3.264 -		echo -e "The package is installed but will probably not work.\n"
   3.265 +		echo ""
   3.266 +		eval_gettext \
   3.267 +"Leaving dependencies for \$PACKAGE unsolved. The package is installed but
   3.268 +will probably not work."; echo
   3.269 +		echo ""
   3.270  	fi
   3.271  }
   3.272  
   3.273 @@ -764,7 +759,7 @@
   3.274  # Search pattern in installed packages.
   3.275  search_in_installed_packages()
   3.276  {
   3.277 -	echo "Installed packages"
   3.278 +	gettext "Installed packages"; echo
   3.279  	echo "================================================================================"
   3.280  	list=`ls -1 $INSTALLED | grep -i "$PATTERN"`
   3.281  	for pkg in $list
   3.282 @@ -779,11 +774,11 @@
   3.283  	done
   3.284  	# Set correct ending messages.
   3.285  	if [ "$packages" = "" ]; then
   3.286 -		echo "0 installed packages found for : $PATTERN"
   3.287 +		eval_gettext "0 installed packages found for : \$PATTERN"; echo
   3.288  		echo ""
   3.289  	else
   3.290  		echo "================================================================================"
   3.291 -		echo "$packages installed package(s) found for : $PATTERN"
   3.292 +		eval_gettext "\$packages installed package(s) found for : \$PATTERN"; echo
   3.293  		echo ""
   3.294  	fi
   3.295  }
   3.296 @@ -791,7 +786,7 @@
   3.297  # Search in packages.list for available pkgs.
   3.298  search_in_packages_list()
   3.299  {
   3.300 -	echo "Available packages name-version"
   3.301 +	gettext "Available packages name-version"; echo
   3.302  	echo "================================================================================"
   3.303  	packages=0
   3.304  	for i in $LOCALSTATE/packages.list $LOCALSTATE/undigest/*/packages.list; do
   3.305 @@ -799,16 +794,18 @@
   3.306  		packages=$(($packages + `grep -is "$PATTERN" $i | wc -l`))
   3.307  	done
   3.308  	if [ ! -f "$LOCALSTATE/packages.list" ]; then
   3.309 -		echo -e "
   3.310 -No 'packages.list' found to check for mirrored packages. For more results,
   3.311 -please run 'tazpkg recharge' once as root before searching.\n"
   3.312 +		echo ""
   3.313 +		gettext \
   3.314 +"No 'packages.list' found to check for mirrored packages. For more results,
   3.315 +please run 'tazpkg recharge' once as root before searching."; echo
   3.316 +		echo ""
   3.317  	fi
   3.318  	if [ "$packages" = "0" ]; then
   3.319 -		echo "0 available packages found for : $PATTERN"
   3.320 +		eval_gettext "0 available packages found for : \$PATTERN"; echo
   3.321  		echo ""
   3.322  	else
   3.323  		echo "================================================================================"
   3.324 -		echo "$packages available package(s) found for : $PATTERN"
   3.325 +		eval_gettext "\$packages available package(s) found for : \$PATTERN"; echo
   3.326  		echo ""
   3.327  	fi
   3.328  }
   3.329 @@ -817,7 +814,7 @@
   3.330  # info than --list or default.
   3.331  search_in_packages_txt()
   3.332  {
   3.333 -	echo "Matching packages name with version and desc"
   3.334 +	gettext "Matching packages name with version and desc"; echo
   3.335  	echo "================================================================================"
   3.336  	packages=0
   3.337  	for i in $LOCALSTATE/packages.txt $LOCALSTATE/undigest/*/packages.txt; do
   3.338 @@ -825,16 +822,18 @@
   3.339  		packages=$(($packages + `grep -is "^$PATTERN" $i | wc -l`))
   3.340  	done
   3.341  	if [ ! -f "$LOCALSTATE/packages.txt" ]; then
   3.342 -		echo -e "
   3.343 -No 'packages.txt' found to check for mirrored packages. For more results,
   3.344 -please run 'tazpkg recharge' once as root before searching.\n"
   3.345 +		echo ""
   3.346 +		gettext \
   3.347 +"No 'packages.txt' found to check for mirrored packages. For more results,
   3.348 +please run 'tazpkg recharge' once as root before searching."; echo
   3.349 +		echo ""
   3.350  	fi
   3.351  	if [ "$packages" = "0" ]; then
   3.352 -		echo "0 available packages found for : $PATTERN"
   3.353 +		eval_gettext "0 available packages found for : \$PATTERN"; echo
   3.354  		echo ""
   3.355  	else
   3.356  		echo "================================================================================"
   3.357 -		echo "$packages available package(s) found for : $PATTERN"
   3.358 +		eval_gettext "\$packages available package(s) found for : \$PATTERN"; echo
   3.359  		echo ""
   3.360  	fi
   3.361  }
   3.362 @@ -877,7 +876,7 @@
   3.363  			tazpkg remove $PACKAGE
   3.364  		done
   3.365  	else
   3.366 -		echo "Can't find flavor $FLAVOR. Aborting."
   3.367 +		eval_gettext "Can't find flavor \$FLAVOR. Aborting."; echo
   3.368  	fi
   3.369  	cd $TOP_DIR
   3.370  	rm -rf $TMP_DIR
   3.371 @@ -891,14 +890,14 @@
   3.372  		cp -f $1/mirror $1/mirror.bak
   3.373  	fi
   3.374  	echo ""
   3.375 -	echo -e "\033[1mCurrent mirror(s)\033[0m"
   3.376 +	echo -e "\033[1m`gettext \"Current mirror(s)\"`\033[0m"
   3.377  	echo "================================================================================"
   3.378  	echo "  `cat $1/mirror 2> /dev/null`"
   3.379 -	echo "
   3.380 -Please enter URL of the new mirror (http, ftp or local path). You must specify
   3.381 -the complete address to the directory of the packages and packages.list file."
   3.382 +	gettext \
   3.383 +"Please enter URL of the new mirror (http, ftp or local path). You must specify
   3.384 +the complete address to the directory of the packages and packages.list file."; echo
   3.385  	echo ""
   3.386 -	echo -n "New mirror(s) URL : "
   3.387 +	gettext "New mirror(s) URL : "
   3.388  	NEW_MIRROR_URL=$2
   3.389  	if [ -n "$NEW_MIRROR_URL" ]; then
   3.390  		echo $NEW_MIRROR_URL
   3.391 @@ -906,9 +905,9 @@
   3.392  		read NEW_MIRROR_URL
   3.393  	fi
   3.394  	if [ "$NEW_MIRROR_URL" = "" ]; then
   3.395 -		echo "Nothing has been changed."
   3.396 +		gettext "Nothing has been changed."; echo
   3.397  	else
   3.398 -		echo "Setting mirror(s) to : $NEW_MIRROR_URL"
   3.399 +		eval_gettext "Setting mirror(s) to : $NEW_MIRROR_URL"; echo
   3.400  		rm -f $1/mirror
   3.401  		for i in $NEW_MIRROR_URL; do
   3.402  			echo "$i" >> $1/mirror
   3.403 @@ -1098,7 +1097,7 @@
   3.404  		mv $TMP_DIR/$file.tazpkg .
   3.405  		;;
   3.406  	*)
   3.407 -		echo "Invalid target: $target (expected i386)"
   3.408 +		gettext "Invalid target: $target (expected i386)"; echo
   3.409  		;;
   3.410  	esac
   3.411  	rm -rf $TMP_DIR
   3.412 @@ -1135,7 +1134,7 @@
   3.413  		tazpkg pack $file
   3.414  		mv $file.tazpkg $TOP_DIR
   3.415  	else
   3.416 -		echo "$PACKAGE_FILE does not look like a Archlinux package !"
   3.417 +		eval_gettext "\$PACKAGE_FILE does not look like a Archlinux package !"; echo
   3.418  	fi
   3.419  	cd $TOP_DIR
   3.420  	rm -rf $TMP_DIR
   3.421 @@ -1186,7 +1185,7 @@
   3.422  		tazpkg pack $file
   3.423  		mv $file.tazpkg $TOP_DIR
   3.424  	else
   3.425 -		echo "$PACKAGE_FILE does not look like a Slackware package !"
   3.426 +		eval_gettext "\$PACKAGE_FILE does not look like a Slackware package !"; echo
   3.427  	fi
   3.428  	cd $TOP_DIR
   3.429  	rm -rf $TMP_DIR
   3.430 @@ -1237,7 +1236,7 @@
   3.431  		mv $file.tazpkg $TOP_DIR
   3.432  		;;
   3.433  	*)
   3.434 -		echo "Invalid target: $target (expected i386)"
   3.435 +		gettext "Invalid target: $target (expected i386)"; echo
   3.436  		;;
   3.437  	esac
   3.438  	cd $TOP_DIR
   3.439 @@ -1302,20 +1301,19 @@
   3.440  		#
   3.441  		if [ "$2" = "blocked" ]; then
   3.442  			echo ""
   3.443 -			echo -e "\033[1mBlocked packages\033[0m"
   3.444 +			echo -e "\033[1m`gettext \"Blocked packages\"`\033[0m"
   3.445  			echo "================================================================================"
   3.446  			if [ -s "$BLOCKED" ];then
   3.447  				cat $BLOCKED
   3.448 -				echo ""
   3.449  			else
   3.450 -				echo -e "No blocked packages found.\n"
   3.451 +				gettext "No blocked packages found."
   3.452  			fi
   3.453 -			exit 0
   3.454 +			echo "" && exit 0
   3.455  		fi
   3.456  		# Display the list of categories.
   3.457  		if [ "$2" = "cat" -o "$2" = "categories" ]; then
   3.458  			echo ""
   3.459 -			echo -e "\033[1mPackages categories :\033[0m"
   3.460 +			echo -e "\033[1m`gettext \"Packages categories\"`\033[0m"
   3.461  			echo "================================================================================"
   3.462  			for i in $CATEGORIES
   3.463  			do
   3.464 @@ -1331,7 +1329,7 @@
   3.465  		if [ -n "$2" ]; then
   3.466  			ASKED_CATEGORY=$2
   3.467  			echo ""
   3.468 -			echo -e "\033[1mInstalled packages of category :\033[0m $ASKED_CATEGORY"
   3.469 +			echo -e "\033[1m`gettext \"Installed packages of category:\"`\033[0m $ASKED_CATEGORY"
   3.470  			echo "================================================================================"
   3.471  			for pkg in $INSTALLED/*
   3.472  			do
   3.473 @@ -1345,12 +1343,12 @@
   3.474  				fi
   3.475  			done
   3.476  			echo "================================================================================"
   3.477 -			echo -e "$packages packages installed of category $ASKED_CATEGORY."
   3.478 +			eval_gettext "\$packages packages installed of category \$ASKED_CATEGORY."; echo
   3.479  			echo ""
   3.480  		else
   3.481  			# By default list all packages and versions.
   3.482  			echo ""
   3.483 -			echo -e "\033[1mList of all installed packages\033[0m"
   3.484 +			echo -e "\033[1m`gettext \"List of all installed packages\"`\033[0m"
   3.485  			echo "================================================================================"
   3.486  			for pkg in $INSTALLED/*
   3.487  			do
   3.488 @@ -1363,7 +1361,7 @@
   3.489  				packages=$(($packages+1))
   3.490  			done
   3.491  			echo "================================================================================"
   3.492 -			echo "$packages packages installed."
   3.493 +			eval_gettext "\$packages packages installed."; echo
   3.494  			echo ""
   3.495  		fi ;;
   3.496  	xhtml-list)
   3.497 @@ -1375,13 +1373,13 @@
   3.498  			XHTML_LIST=installed-packages.html
   3.499  		fi
   3.500  		echo ""
   3.501 -		echo -e "\033[1mCreating xHTML list of installed packages\033[0m"
   3.502 +		echo -e "\033[1m`gettext \"Creating xHTML list of installed packages\"`\033[0m"
   3.503  		echo "================================================================================"
   3.504 -		echo -n "Generating xHTML header..."
   3.505 +		gettext "Generating xHTML header..."
   3.506  		xhtml_header
   3.507  		status
   3.508  		# Packages
   3.509 -		echo -n "Creating packages information..."
   3.510 +		gettext "Creating packages information..."
   3.511  		for pkg in $INSTALLED/*
   3.512  		do
   3.513  			[ -f $pkg/receipt ] || continue
   3.514 @@ -1391,13 +1389,13 @@
   3.515  			packages=$(($packages+1))
   3.516  		done
   3.517  		status
   3.518 -		echo -n "Generating xHTML footer..."
   3.519 +		gettext "Generating xHTML footer..."
   3.520  		xhtml_footer
   3.521  		status
   3.522  		# sed pkgs nb in header.
   3.523  		sed -i s/'_packages_'/"$packages"/ $XHTML_LIST
   3.524  		echo "================================================================================"
   3.525 -		echo "$XHTML_LIST created - $packages packages."
   3.526 +		eval_gettext "\$XHTML_LIST created - $packages packages."; echo
   3.527  		echo "" ;;
   3.528  	list-mirror)
   3.529  		# List all available packages on the mirror. Option --diff displays
   3.530 @@ -1407,31 +1405,33 @@
   3.531  			--diff)
   3.532  				if [ -f "$LOCALSTATE/packages.diff" ]; then
   3.533  					echo ""
   3.534 -					echo -e "\033[1mMirrored packages diff\033[0m"
   3.535 +					echo -e "\033[1m`gettext \"Mirrored packages diff\"`\033[0m"
   3.536  					echo "================================================================================"
   3.537  					cat $LOCALSTATE/packages.diff
   3.538  					echo "================================================================================"
   3.539  					pkgs=`cat $LOCALSTATE/packages.diff | wc -l`
   3.540 -					echo "$pkgs new packages listed on the mirror."
   3.541 +					eval_gettext "\$pkgs new packages listed on the mirror."; echo
   3.542  					echo ""
   3.543  				else
   3.544 -					 echo -e "\nUnable to list anything, no packages.diff found."
   3.545 -					 echo -e "Recharge your current list to create a first diff.\n"
   3.546 +					echo ""
   3.547 +					gettext "Unable to list anything, no packages.diff found."; echo
   3.548 +					gettext "Recharge your current list to create a first diff."; echo
   3.549 +					echo ""
   3.550  				fi && exit 0 ;;
   3.551  			--text|--txt)
   3.552  				echo ""
   3.553 -				echo -e "\033[1mList of available packages on the mirror\033[0m"
   3.554 +				echo -e "\033[1m`gettext \"List of available packages on the mirror\"`\033[0m"
   3.555  				echo "================================================================================"
   3.556  				cat $LOCALSTATE/packages.txt ;;
   3.557  			--raw|*)
   3.558  				echo ""
   3.559 -				echo -e "\033[1mList of available packages on the mirror\033[0m"
   3.560 +				echo -e "\033[1m`gettext \"List of available packages on the mirror\"`\033[0m"
   3.561  				echo "================================================================================"
   3.562  				cat $LOCALSTATE/packages.list ;;
   3.563  		esac
   3.564  		echo "================================================================================"
   3.565  		pkgs=`cat $LOCALSTATE/packages.list | wc -l`
   3.566 -		echo "$pkgs packages in the last recharged list."
   3.567 +		eval_gettext "\$pkgs packages in the last recharged list."; echo
   3.568  		echo "" ;;
   3.569  	list-files)
   3.570  		# List files installed with the package.
   3.571 @@ -1439,7 +1439,7 @@
   3.572  		check_for_package_on_cmdline
   3.573  		check_for_receipt
   3.574  		echo ""
   3.575 -		echo -e "\033[1mInstalled files with :\033[0m $PACKAGE"
   3.576 +		echo -e "\033[1m`gettext \"Installed files with:\"`\033[0m $PACKAGE"
   3.577  		echo "================================================================================"
   3.578  		cat $INSTALLED/$PACKAGE/files.list | sort
   3.579  		echo "================================================================================"
   3.580 @@ -1454,7 +1454,7 @@
   3.581  		EXTRAVERSION=""
   3.582  		. $INSTALLED/$PACKAGE/receipt
   3.583  		echo ""
   3.584 -		echo -e "\033[1mTazpkg information\033[0m
   3.585 +		echo -e "\033[1m`gettext \"Tazpkg information\"`\033[0m
   3.586  ================================================================================
   3.587  Package    : $PACKAGE
   3.588  Version    : $VERSION$EXTRAVERSION
   3.589 @@ -1482,25 +1482,29 @@
   3.590  		# Display package description.txt if available.
   3.591  		if [ -f "$INSTALLED/$PACKAGE/description.txt" ]; then
   3.592  			echo ""
   3.593 -			echo -e "\033[1mDescription of :\033[0m $PACKAGE"
   3.594 +			echo -e "\033[1m`gettext \"Description of:\"`\033[0m $PACKAGE"
   3.595  			echo "================================================================================"
   3.596  			cat $INSTALLED/$PACKAGE/description.txt
   3.597  			echo "================================================================================"
   3.598  			echo ""
   3.599  		else
   3.600 -			echo -e "\nSorry, no description available for this package.\n"
   3.601 +			echo ""
   3.602 +			gettext "Sorry, no description available for this package."; echo
   3.603 +			echo ""
   3.604  		fi ;;
   3.605  	search)
   3.606  		# Search for a package by pattern or name.
   3.607  		#
   3.608  		PATTERN="$2"
   3.609  		if [ -z "$PATTERN" ]; then
   3.610 -			echo -e "\nPlease specify a pattern or package name to search for."
   3.611 -			echo -e "Example : 'tazpkg search paint'.\n"
   3.612 +			echo ""
   3.613 +			gettext "Please specify a pattern or package name to search for."; echo
   3.614 +			gettext "Example : 'tazpkg search paint'"; echo
   3.615 +			echo ""
   3.616  			exit 0
   3.617  		fi
   3.618  		echo ""
   3.619 -		echo -e "\033[1mSearch result for :\033[0m $PATTERN"
   3.620 +		echo -e "\033[1m`gettext \"Search result for:\"`\033[0m $PATTERN"
   3.621  		echo ""
   3.622  		# Default is to search in installed pkgs and the raw list.
   3.623  		case $3 in
   3.624 @@ -1518,12 +1522,14 @@
   3.625  		# Search for a file by pattern or name in all files.list.
   3.626  		#
   3.627  		if [ -z "$2" ]; then
   3.628 -			echo -e "\nPlease specify a pattern or file name to search for."
   3.629 -			echo -e "Example : 'tazpkg search-file libnss'. \n"
   3.630 +			echo ""
   3.631 +			gettext "Please specify a pattern or file name to search for."; echo
   3.632 +			gettext "Example : 'tazpkg search-file libnss'"; echo
   3.633 +			echo ""
   3.634  			exit 0
   3.635  		fi
   3.636  		echo ""
   3.637 -		echo -e "\033[1mSearch result for file :\033[0m $2"
   3.638 +		echo -e "\033[1m`gettext \"Search result for file\"`\033[0m $2"
   3.639  		echo "================================================================================"
   3.640  
   3.641  		if [ "$3" == "--mirror" ]; then
   3.642 @@ -1555,7 +1561,7 @@
   3.643  			if grep -qs "$2" $pkg/files.list; then
   3.644  				. $pkg/receipt
   3.645  				echo ""
   3.646 -				echo -e "\033[1mPackage $PACKAGE :\033[0m"
   3.647 +				echo -e "\033[1m`gettext \"Package\"` $PACKAGE:\033[0m"
   3.648  				grep "$2" $pkg/files.list
   3.649  				files=`grep $2 $pkg/files.list | wc -l`
   3.650  				match=$(($match+$files))
   3.651 @@ -1563,25 +1569,27 @@
   3.652  		done
   3.653  
   3.654  		fi
   3.655 -
   3.656 +		pkg=$2
   3.657  		if [ "$match" = "" ]; then
   3.658 -			echo "0 file found for : $2"
   3.659 +			eval_gettext "0 file found for: \$pkg"; echo
   3.660  			echo ""
   3.661  		else
   3.662  			echo ""
   3.663  			echo "================================================================================"
   3.664 -			echo "$match file(s) found for : $2"
   3.665 +			eval_gettext "\$match file(s) found for: \$pkg"; echo
   3.666  			echo ""
   3.667  		fi ;;
   3.668  	search-pkgname) 
   3.669 -		#
   3.670 +		# Search for a package name
   3.671  		if [ -z "$2" ]; then
   3.672 -			echo -e "\nPlease specify a pattern or file name to search for."
   3.673 -			echo -e "Example : 'tazpkg search-pkgname libnss'. \n"
   3.674 +			echo ""
   3.675 +			gettext "Please specify a pattern or file name to search for."; echo
   3.676 +			gettext "Example : 'tazpkg search-pkgname libnss'"; echo
   3.677 +			echo ""
   3.678  			exit 0
   3.679  		fi
   3.680  		echo ""
   3.681 -		echo -e "\033[1mSearch result for file :\033[0m $2"
   3.682 +		echo -e "\033[1m`gettext \"Search result for file\"`\033[0m $2"
   3.683  		echo "================================================================================"
   3.684         
   3.685  	 # Search for a file on mirror and output only the package name
   3.686 @@ -1592,14 +1600,14 @@
   3.687  				unlzma -c $i | grep -- ".*:.*$2" | cut -d: -f1 | uniq | awk '{ print $1 }'
   3.688  				match=$(($match + `unlzma -c $i | grep -- ".*:.*$2" | cut -d: -f1 | uniq | wc -l`))
   3.689  		done
   3.690 -			
   3.691 +		file=$2
   3.692  		if [ "$match" = "" ]; then
   3.693 -			echo "0 file found for : $2"
   3.694 +			eval_gettext "0 file found for : \$file"; echo
   3.695  			echo ""
   3.696  		else
   3.697  			echo ""
   3.698  			echo "================================================================================"
   3.699 -			echo "$match pkg(s) found with file : $2"
   3.700 +			eval_gettext "$match pkg(s) found with file: \$file"; echo
   3.701  			echo ""
   3.702  		fi
   3.703  		;;
   3.704 @@ -1639,14 +1647,16 @@
   3.705  		#
   3.706  		check_root
   3.707  		if [ -z "$2" ]; then
   3.708 -			echo -e "
   3.709 -Please change directory (cd) to the packages repository, and specify the
   3.710 -list of packages to install. Example : tazpkg install-list packages.list\n"
   3.711 -			exit 0
   3.712 +			echo ""
   3.713 +			gettext \
   3.714 +"Please change directory (cd) to the packages repository, and specify the
   3.715 +list of packages to install. Example : tazpkg install-list packages.list"
   3.716 +			echo "" && exit 0
   3.717  		fi
   3.718  		# Check if the packages list exist.
   3.719 -		if [ ! -f "$2" ]; then
   3.720 -			echo "Unable to find : $2"
   3.721 +		list_file=$2
   3.722 +		if [ ! -f "$list_file" ]; then
   3.723 +			gettext "Unable to find : $list_file"; echo
   3.724  			exit 0
   3.725  		else
   3.726  			LIST=`cat $2`
   3.727 @@ -1693,8 +1703,10 @@
   3.728  		#
   3.729  		RELEASE=$2
   3.730  		if [ -z "$RELEASE" ]; then
   3.731 -			echo -e "\nPlease specify the release you want on the command line."
   3.732 -			echo -e "Example: tazpkg set-release cooking\n"
   3.733 +			echo ""
   3.734 +			gettext "Please specify the release you want on the command line."; echo
   3.735 +			gettext "Example: tazpkg set-release cooking"; echo
   3.736 +			echo ""
   3.737  			exit 0
   3.738  		fi
   3.739  		rm /var/lib/tazpkg/mirror
   3.740 @@ -1716,7 +1728,8 @@
   3.741  		check_root
   3.742  		check_for_package_on_cmdline
   3.743  		if [ ! -f "$INSTALLED/$PACKAGE/receipt" ]; then
   3.744 -			echo -e "\n$PACKAGE is not installed.\n"
   3.745 +			echo ""
   3.746 +			eval_gettext "\$PACKAGE is not installed."; echo
   3.747  			exit 0
   3.748  		else
   3.749  			ALTERED=""
   3.750 @@ -1734,29 +1747,29 @@
   3.751  		fi
   3.752  		echo ""
   3.753  		if [ -n "$ALTERED" ]; then
   3.754 -			echo "The following packages depend on $PACKAGE :"
   3.755 +			eval_gettext "The following packages depend on \$PACKAGE:"; echo
   3.756  			for i in $ALTERED; do
   3.757  				echo "  $i"
   3.758  			done
   3.759  		fi
   3.760  		REFRESH=$(cd $INSTALLED ; grep -sl ^$PACKAGE$ */modifiers)
   3.761  		if [ -n "$REFRESH" ]; then
   3.762 -			echo "The following packages have been modified by $PACKAGE :"
   3.763 +			eval_gettext "The following packages have been modified by \$PACKAGE:"; echo
   3.764  			for i in $REFRESH; do
   3.765  				echo "  ${i%/modifiers}"
   3.766  			done
   3.767  		fi
   3.768 -		echo "Remove $PACKAGE ($VERSION$EXTRAVERSION) ?"
   3.769 -		echo -n "Please confirm uninstallation (y/N) : "; read anser
   3.770 +		eval_gettext "Remove \$PACKAGE (\$VERSION\$EXTRAVERSION) ?"; echo
   3.771 +		gettext "Please confirm uninstallation (y/N) : "; read anser
   3.772  		if [ "$anser" = "y" ]; then
   3.773  			echo ""
   3.774 -			echo -e "\033[1mRemoving :\033[0m $PACKAGE"
   3.775 +			echo -e "\033[1m`gettext \"Removing:\"`\033[0m $PACKAGE"
   3.776  			echo "================================================================================"
   3.777  			# Pre remove commands.
   3.778  			if grep -q ^pre_remove $INSTALLED/$PACKAGE/receipt; then
   3.779  				pre_remove
   3.780  			fi
   3.781 -			echo -n "Removing all files installed..."
   3.782 +			gettext "Removing all files installed..."
   3.783  			if [ -f $INSTALLED/$PACKAGE/modifiers ]; then
   3.784  			    for mod in `cat $INSTALLED/$PACKAGE/modifiers`
   3.785  			    do
   3.786 @@ -1777,7 +1790,7 @@
   3.787  				post_remove
   3.788  			fi
   3.789  			# Remove package receipt.
   3.790 -			echo -n "Removing package receipt..."
   3.791 +			gettext "Removing package receipt..."
   3.792  			rm -rf $INSTALLED/$PACKAGE
   3.793  			status
   3.794  			sed -i "/ $PACKAGE-$VERSION$EXTRAVERSION$/d" \
   3.795 @@ -1785,7 +1798,7 @@
   3.796  			# Log this activity
   3.797  			log Removed
   3.798  			if [ -n "$ALTERED" ]; then
   3.799 -				echo -n "Remove packages depending on $PACKAGE"
   3.800 +				eval_gettext "Remove packages depending on \$PACKAGE"
   3.801  				echo -n " (y/N) ? "; read anser
   3.802  				if [ "$anser" = "y" ]; then
   3.803  					for i in $ALTERED; do
   3.804 @@ -1796,12 +1809,12 @@
   3.805  				fi
   3.806  			fi
   3.807  			if [ -n "$REFRESH" ]; then
   3.808 -				echo -n "Reinstall packages modified by $PACKAGE"
   3.809 +				eval_gettext "Reinstall packages modified by \$PACKAGE"
   3.810  				echo -n " (y/N) ? "; read anser
   3.811  				if [ "$anser" = "y" ]; then
   3.812  					for i in $REFRESH; do
   3.813  						if [ $(wc -l < $INSTALLED/$i) -gt 1 ]; then
   3.814 -							echo "Check $INSTALLED/$i for reinstallation"
   3.815 +							eval_gettext "Check \$INSTALLED/\$i for reinstallation"; echo
   3.816  							continue
   3.817  						fi
   3.818  						rm -r $INSTALLED/$i
   3.819 @@ -1811,7 +1824,7 @@
   3.820  			fi
   3.821  		else
   3.822  			echo ""
   3.823 -			echo "Uninstallation of $PACKAGE cancelled."
   3.824 +			eval_gettext "Uninstallation of \$PACKAGE cancelled."; echo
   3.825  		fi
   3.826  		echo "" ;;
   3.827  	extract)
   3.828 @@ -1820,7 +1833,7 @@
   3.829  		check_for_package_on_cmdline
   3.830  		check_for_package_file
   3.831  		echo ""
   3.832 -		echo -e "\033[1mExtracting :\033[0m $PACKAGE"
   3.833 +		echo -e "\033[1m`gettext \"Extracting:\"`\033[0m $PACKAGE"
   3.834  		echo "================================================================================"
   3.835  		# If no directory destination is found on the cmdline
   3.836  		# we create one in the current dir using the package name.
   3.837 @@ -1830,13 +1843,13 @@
   3.838  			DESTDIR=$PACKAGE
   3.839  		fi
   3.840  		mkdir -p $DESTDIR
   3.841 -		echo -n "Copying original package..."
   3.842 +		gettext "Copying original package..."
   3.843  		cp $PACKAGE_FILE $DESTDIR
   3.844  		status
   3.845  		cd $DESTDIR
   3.846  		extract_package
   3.847  		echo "================================================================================"
   3.848 -		echo "$PACKAGE is extracted to : $DESTDIR"
   3.849 +		eval_gettext "\$PACKAGE is extracted to: \$DESTDIR"; echo
   3.850  		echo "" ;;
   3.851  	recompress)
   3.852  		# Recompress .tazpkg cpio archive with lzma.
   3.853 @@ -1844,19 +1857,19 @@
   3.854  		check_for_package_on_cmdline
   3.855  		check_for_package_file
   3.856  		echo ""
   3.857 -		echo -e "\033[1mRecompressing :\033[0m $PACKAGE"
   3.858 +		echo -e "\033[1m`gettext \"Recompressing:\"`\033[0m $PACKAGE"
   3.859  		echo "================================================================================"
   3.860  		mkdir -p $TMP_DIR
   3.861 -		echo -n "Copying original package..."
   3.862 +		gettext "Copying original package..."
   3.863  		cp $PACKAGE_FILE $TMP_DIR
   3.864  		status
   3.865  		cd $TMP_DIR
   3.866  		extract_package
   3.867 -		echo -n "Recompressing the fs... "
   3.868 +		gettext "Recompressing the fs... "
   3.869  		find fs | cpio -o -H newc 2> /dev/null | lzma e fs.cpio.lzma -si
   3.870  		rm -rf fs
   3.871  		status
   3.872 -		echo -n "Creating new package... "
   3.873 +		gettext "Creating new package... "
   3.874  		find . -print | cpio -o -H newc > \
   3.875  			$TOP_DIR/$(basename $PACKAGE_FILE).$$ && mv -f \
   3.876  			$TOP_DIR/$(basename $PACKAGE_FILE).$$ \
   3.877 @@ -1889,7 +1902,7 @@
   3.878  			rm -rf $TMP_DIR
   3.879  		else
   3.880  			echo ""
   3.881 -			echo -e "\033[1mConfiguration files"
   3.882 +			echo -e "\033[1m`gettext \"Configuration files\"`"
   3.883  			echo "================================================================================"
   3.884  			for i in $INSTALLED/*/volatile.cpio.gz; do
   3.885  				[ -n "$2" -a "$i" != "$INSTALLED/$2/volatile.cpio.gz" ] && continue
   3.886 @@ -1950,7 +1963,7 @@
   3.887  			exit 1
   3.888  		fi
   3.889  		if [ -s $INSTALLED/$PACKAGE/modifiers ]; then
   3.890 -			echo "Can't repack, $PACKAGE files have been modified by:"
   3.891 +			eval_gettext "Can't repack, \$PACKAGE files have been modified by:"; echo
   3.892  			for i in $(cat $INSTALLED/$PACKAGE/modifiers); do
   3.893  				echo "  $i"
   3.894  			done
   3.895 @@ -1962,7 +1975,7 @@
   3.896  			[ -L "$i" ] || MISSING="$MISSING\n  $i"
   3.897  		done < $INSTALLED/$PACKAGE/files.list
   3.898  		if [ -n "$MISSING" ]; then
   3.899 -			echo -n "Can't repack, the following files are lost:"
   3.900 +			gettext "Can't repack, the following files are lost:"
   3.901  			echo -e "$MISSING"
   3.902  			exit 1
   3.903  		fi
   3.904 @@ -2000,7 +2013,7 @@
   3.905  			$TOP_DIR/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg
   3.906  		cd $TOP_DIR
   3.907  		\rm -R $TMP_DIR
   3.908 -		echo "Package $PACKAGE repacked successfully."
   3.909 +		eval_gettext "Package \$PACKAGE repacked successfully."; echo
   3.910  		echo "Size : `du -sh $PACKAGE-$VERSION$EXTRAVERSION.tazpkg`"
   3.911  		echo "" ;;
   3.912  	pack)
   3.913 @@ -2009,19 +2022,19 @@
   3.914  		check_for_package_on_cmdline
   3.915  		cd $PACKAGE
   3.916  		if [ ! -f "receipt" ]; then
   3.917 -			echo "Receipt is missing. Please read the documentation."
   3.918 +			gettext "Receipt is missing. Please read the documentation."; echo
   3.919  			exit 0
   3.920  		else
   3.921  			echo ""
   3.922  			echo -e "\033[1mPacking :\033[0m $PACKAGE"
   3.923  			echo "================================================================================"
   3.924  			# Create files.list with redirecting find outpout.
   3.925 -			echo -n "Creating the list of files..." && cd fs
   3.926 +			gettext "Creating the list of files..." && cd fs
   3.927  			find . -type f -print > ../files.list
   3.928  			find . -type l -print >> ../files.list
   3.929  			cd .. && sed -i s/'^.'/''/ files.list
   3.930  			status
   3.931 -			echo -n "Creating md5sum of files..."
   3.932 +			gettext "Creating md5sum of files..."
   3.933  			while read file; do
   3.934  				[ -L "fs$file" ] && continue
   3.935  				[ -f "fs$file" ] || continue
   3.936 @@ -2035,27 +2048,27 @@
   3.937  				description.txt 2> /dev/null | awk \
   3.938  				'{ sz=$1 } END { print sz }')
   3.939  			# Build cpio archives.
   3.940 -			echo -n "Compressing the fs... "
   3.941 +			gettext "Compressing the fs... "
   3.942  			find fs | cpio -o -H newc | lzma e fs.cpio.lzma -si
   3.943  			rm -rf fs
   3.944  			status
   3.945  			PACKED_SIZE=$(du -chs fs.cpio.lzma receipt files.list \
   3.946  				md5sum description.txt 2> /dev/null | awk \
   3.947  				'{ sz=$1 } END { print sz }')
   3.948 -			echo -n "Undating receipt sizes..."
   3.949 +			gettext "Undating receipt sizes..."
   3.950  			sed -i s/^PACKED_SIZE.*$// receipt
   3.951  			sed -i s/^UNPACKED_SIZE.*$// receipt
   3.952  			sed -i "s/^PACKAGE=/PACKED_SIZE=\"$PACKED_SIZE\"\nUNPACKED_SIZE=\"$UNPACKED_SIZE\"\nPACKAGE=/" receipt
   3.953  			status
   3.954 -			echo -n "Creating full cpio archive... "
   3.955 +			gettext "Creating full cpio archive... "
   3.956  			find . -print | cpio -o -H newc > ../$PACKAGE.tazpkg
   3.957  			status
   3.958 -			echo -n "Restoring original package tree... "
   3.959 +			gettext "Restoring original package tree... "
   3.960  			unlzma -c fs.cpio.lzma | cpio -idm
   3.961  			status
   3.962  			rm fs.cpio.lzma && cd ..
   3.963  			echo "================================================================================"
   3.964 -			echo "Package $PACKAGE compressed successfully."
   3.965 +			eval_gettext "Package \$PACKAGE compressed successfully."; echo
   3.966  			echo "Size : `du -sh $PACKAGE.tazpkg`"
   3.967  			echo ""
   3.968  		fi ;;
   3.969 @@ -2071,7 +2084,7 @@
   3.970  			fi
   3.971  			cd $path
   3.972  			if [ -f "packages.list" ]; then
   3.973 -				echo -n "Creating backup of the last packages list..."
   3.974 +				gettext "Creating backup of the last packages list..."
   3.975  				mv -f packages.desc packages.desc.bak 2>/dev/null
   3.976  				mv -f packages.md5 packages.md5.txt 2>/dev/null
   3.977  				mv -f packages.txt packages.txt.bak 2>/dev/null
   3.978 @@ -2098,22 +2111,26 @@
   3.979  				diff -u packages.list.bak packages.list | grep ^+[a-z] > packages.diff
   3.980  				sed -i s/+// packages.diff
   3.981  				echo ""
   3.982 -				echo -e "\033[1mMirrored packages diff\033[0m"
   3.983 +				echo -e "\033[1m`gettext \"Mirrored packages diff\"`\033[0m"
   3.984  				echo "================================================================================"
   3.985  				cat packages.diff
   3.986 -				if [ ! "`cat packages.diff | wc -l`" = 0 ]; then
   3.987 +				new_pkgs=`cat packages.diff | wc -l`
   3.988 +				if [ "$new_pkgs" != 0 ]; then
   3.989  					echo "================================================================================"
   3.990 -					echo "`cat packages.diff | wc -l` new packages on the mirror."
   3.991 +					eval_gettext "\$new_pkgs new packages on the mirror."; echo
   3.992  					echo ""
   3.993  				else
   3.994 -					echo "`cat packages.diff | wc -l` new packages on the mirror."
   3.995 +					gettext "No new packages on the mirror."; echo
   3.996  					echo ""
   3.997  				fi
   3.998  			else
   3.999  				echo -e "
  3.1000 -================================================================================
  3.1001 -Last packages.list is ready to use. Note that next time you recharge the list,
  3.1002 -a list of differences will be displayed to show new and upgradeable packages.\n"
  3.1003 +================================================================================"
  3.1004 +				gettext \
  3.1005 +"Last packages.list is ready to use. Note that next time you recharge the
  3.1006 +list, a list of differences will be displayed to show new and upgradeable
  3.1007 +packages."
  3.1008 +			echo ""
  3.1009  			fi
  3.1010  		done ;;
  3.1011  	upgradeable)
  3.1012 @@ -2141,7 +2158,7 @@
  3.1013  		touch blocked-packages.list
  3.1014  		rm -f upgradeable-packages.list
  3.1015  		echo ""
  3.1016 -		echo -e "\033[1mAvailable upgrades\033[0m"
  3.1017 +		echo -e "\033[1m`gettext \"Available upgrades\"`\033[0m"
  3.1018  		echo "================================================================================"
  3.1019  		echo ""
  3.1020  		# Some packages must be installed first
  3.1021 @@ -2208,7 +2225,7 @@
  3.1022  							FIXE=""
  3.1023  						fi
  3.1024  						if [ "$NEW_MAJOR" -lt "$PKG_MAJOR" ] 2> /dev/null; then
  3.1025 -							RELEASE=$WARNING
  3.1026 +							RELEASE=WARNING
  3.1027  							FIXE=yes
  3.1028  						fi
  3.1029  						# Default to revision.
  3.1030 @@ -2239,27 +2256,30 @@
  3.1031  		if [ ! "$up" = "" ]; then
  3.1032  			echo -e "\\033[0G                                         "
  3.1033  			echo "================================================================================"
  3.1034 -			echo "$packages installed and listed packages to consider, $up to upgrade, $blocked blocked."
  3.1035 +			eval_gettext "\$packages installed and listed packages to consider, \$up to upgrade, \$blocked blocked."; echo
  3.1036  			echo ""
  3.1037  		else
  3.1038 -			echo -e "\\033[0GSystem is up-to-date.                    "
  3.1039 +			echo -e "\\033[0G`gettext \"System is up-to-date.\"`                    "
  3.1040  			echo ""
  3.1041  			echo "================================================================================"
  3.1042 -			echo "$packages installed and listed packages to consider, 0 to upgrade, $blocked blocked."
  3.1043 +			eval_gettext "\$packages installed and listed packages to consider, 0 to upgrade, \$blocked blocked."; echo
  3.1044  			echo ""
  3.1045  			exit 0
  3.1046  		fi
  3.1047  		# What to do if major or minor version is smaller.
  3.1048  		if [ "$FIXE" == "yes" ]; then
  3.1049 -			echo -e "$WARNING ---> Installed package seems more recent than the mirrored one."
  3.1050 -			echo "You can block packages using the command : 'tazpkg block package'"
  3.1051 -			echo "Or upgrade packages at your own risk."
  3.1052 +			gettext \
  3.1053 +"WARNING ---> Installed package seems more recent than the mirrored
  3.1054 +one. You can block packages using the command : 'tazpkg block package'.
  3.1055 +Or upgrade packages at your own risk."
  3.1056  			echo ""
  3.1057  		fi
  3.1058  		# Ask for upgrade, it can be done another time.
  3.1059  		echo -n "Upgrade now (y/N) ? "; read anser
  3.1060  		if [ ! "$anser" = "y" ]; then
  3.1061 -			echo -e "\nExiting. No package upgraded.\n"
  3.1062 +			echo ""
  3.1063 +			gettext "Exiting. No package upgraded."; echo
  3.1064 +			echo ""
  3.1065  			exit 0
  3.1066  		fi
  3.1067  		# If anser is yes (y). Install all new versions.
  3.1068 @@ -2275,17 +2295,16 @@
  3.1069  		shift
  3.1070  		LIST=$@
  3.1071  		[ -n "$LIST" ] || LIST=`ls`
  3.1072 -		MSG="No known bugs."
  3.1073 +		MSG=`gettext "No known bugs."`
  3.1074  		for PACKAGE in $LIST; do
  3.1075  			BUGS=""
  3.1076  			EXTRAVERSION=""
  3.1077  			. $PACKAGE/receipt
  3.1078  			if [ -n "$BUGS" ]; then
  3.1079 -				MSG="
  3.1080 -Bug list completed"
  3.1081 +				MSG=`gettext "Bug list completed"`
  3.1082 +				echo ""
  3.1083 +				eval_gettext "Bugs in package \$PACKAGE version \$VERSION\$EXTRAVERSION:"; echo
  3.1084  				cat <<EOT
  3.1085 -
  3.1086 -Bugs in package $PACKAGE version $VERSION$EXTRAVERSION:
  3.1087    $BUGS
  3.1088  EOT
  3.1089  			fi
  3.1090 @@ -2298,14 +2317,15 @@
  3.1091  		cd $INSTALLED
  3.1092  		for PACKAGE in `ls`; do
  3.1093  			if [ ! -f $PACKAGE/receipt ]; then
  3.1094 -				echo "The package $PACKAGE installation has not completed"
  3.1095 +				eval_gettext "The package \$PACKAGE installation has not completed"; echo
  3.1096  				continue
  3.1097  			fi
  3.1098  			DEPENDS=""
  3.1099  			EXTRAVERSION=""
  3.1100  			. $PACKAGE/receipt
  3.1101  			if [ -s $PACKAGE/modifiers ]; then
  3.1102 -				echo "The package $PACKAGE $VERSION$EXTRAVERSION has been modified by :"
  3.1103 +				eval_gettext \
  3.1104 +					"The package \$PACKAGE \$VERSION\$EXTRAVERSION has been modified by:"; echo
  3.1105  				for i in $(cat $PACKAGE/modifiers); do
  3.1106  					echo "  $i"
  3.1107  				done
  3.1108 @@ -2383,11 +2403,11 @@
  3.1109  		check_for_package_on_cmdline
  3.1110  		echo ""
  3.1111  		if grep -qs "^$PACKAGE" $BLOCKED; then
  3.1112 -			echo "$PACKAGE is already in the blocked packages list."
  3.1113 +			eval_gettext "\$PACKAGE is already in the blocked packages list."; echo
  3.1114  			echo ""
  3.1115  			exit 0
  3.1116  		else
  3.1117 -			echo -n "Add $PACKAGE to : $BLOCKED..."
  3.1118 +			eval_gettext "Add \$PACKAGE to : \$BLOCKED..."
  3.1119  			echo $PACKAGE >> $BLOCKED
  3.1120  			status
  3.1121  			# Log this activity
  3.1122 @@ -2402,7 +2422,7 @@
  3.1123  		check_for_package_on_cmdline
  3.1124  		echo ""
  3.1125  		if grep -qs "^$PACKAGE" $BLOCKED; then
  3.1126 -			echo -n "Removing $PACKAGE from : $BLOCKED..."
  3.1127 +			eval_gettext "Removing \$PACKAGE from : \$BLOCKED..."
  3.1128  			sed -i s/$PACKAGE/''/ $BLOCKED
  3.1129  			sed -i '/^$/d' $BLOCKED
  3.1130  			status
  3.1131 @@ -2410,7 +2430,7 @@
  3.1132  			. $INSTALLED/$PACKAGE/receipt
  3.1133  			log Unblocked
  3.1134  		else
  3.1135 -			echo "$PACKAGE is not in the blocked packages list."
  3.1136 +			eval_gettext "\$PACKAGE is not in the blocked packages list."
  3.1137  			echo ""
  3.1138  			exit 0
  3.1139  		fi
  3.1140 @@ -2470,7 +2490,7 @@
  3.1141  			echo "$PACKAGE already in the cache : $CACHE_DIR"
  3.1142  			# Check package download was finished
  3.1143  			tail -c 2k $PACKAGE.tazpkg | grep -q 00000000TRAILER || {
  3.1144 -				echo "Continue $PACKAGE download"
  3.1145 +				eval_gettext "Continue \$PACKAGE download"; echo
  3.1146  				download $PACKAGE.tazpkg
  3.1147  			}
  3.1148  		else
  3.1149 @@ -2486,13 +2506,13 @@
  3.1150  		check_root
  3.1151  		files=`ls -1 $CACHE_DIR | wc -l`
  3.1152  		echo ""
  3.1153 -		echo -e "\033[1mClean cache :\033[0m $CACHE_DIR"
  3.1154 +		echo -e "\033[1m`gettext \"Clean cache:\"`\033[0m $CACHE_DIR"
  3.1155  		echo "================================================================================"
  3.1156 -		echo -n "Cleaning cache directory..."
  3.1157 +		gettext "Cleaning cache directory..."
  3.1158  		rm -rf $CACHE_DIR/*
  3.1159  		status
  3.1160  		echo "================================================================================"
  3.1161 -		echo "$files file(s) removed from cache."
  3.1162 +		eval_gettext "\$files file(s) removed from cache."; echo
  3.1163  		echo "" ;;
  3.1164  	list-undigest)
  3.1165  		# list undigest URLs.
  3.1166 @@ -2504,11 +2524,11 @@
  3.1167  			done
  3.1168  		else
  3.1169  			echo ""
  3.1170 -			echo -e "\033[1mCurrent undigest(s)\033[0m"
  3.1171 +			echo -e "\033[1m`gettext \"Current undigest(s)\"`\033[0m"
  3.1172  			echo "================================================================================"
  3.1173  			for i in $LOCALSTATE/undigest/*/mirror; do
  3.1174  				if [ ! -f $i ]; then
  3.1175 -					echo "No undigest mirror found."
  3.1176 +					gettext "No undigest mirror found."; echo
  3.1177  					exit 1
  3.1178  				fi
  3.1179  				echo "$(basename $(dirname $i))	$(cat $i)"
  3.1180 @@ -2544,7 +2564,7 @@
  3.1181  			undigest=$i
  3.1182  		fi
  3.1183  		if [ ! -d $LOCALSTATE/undigest/$undigest ]; then
  3.1184 -			echo "Creating new undigest $undigest."
  3.1185 +			eval_gettext "Creating new undigest \$undigest."; echo
  3.1186  			mkdir $LOCALSTATE/undigest/$undigest
  3.1187  		fi
  3.1188  		setup_mirror $LOCALSTATE/undigest/$undigest $3 ;;
  3.1189 @@ -2578,11 +2598,14 @@
  3.1190  				# Log this activity
  3.1191  				[ -n "$ROOT" ] || log Reconfigured
  3.1192  			else
  3.1193 -				echo -e "\nNothing to do for $PACKAGE."
  3.1194 +				echo ""
  3.1195 +				eval_gettext "Nothing to do for \$PACKAGE."; echo
  3.1196  			fi
  3.1197  		else
  3.1198 -			echo -e "\npackage $PACKAGE is not installed."
  3.1199 -			echo -e "Install package with 'tazpkg install' or 'tazpkg get-install'\n"
  3.1200 +			echo ""
  3.1201 +			eval_gettext "package \$PACKAGE is not installed."; echo
  3.1202 +			gettext "Install package with 'tazpkg install' or 'tazpkg get-install'"; echo
  3.1203 +			echo ""
  3.1204  		fi ;;
  3.1205  	shell)
  3.1206  		# Tazpkg SHell
  3.1207 @@ -2597,7 +2620,7 @@
  3.1208  			echo ""
  3.1209  			echo -e "\033[1mTazpkg SHell.\033[0m"
  3.1210  			echo "================================================================================"
  3.1211 -			echo "Type 'usage' to list all available commands or 'quit' or 'q' to exit."
  3.1212 +			gettext "Type 'usage' to list all available commands or 'quit' or 'q' to exit."; echo
  3.1213  			echo ""
  3.1214  		fi
  3.1215  		while true
  3.1216 @@ -2607,7 +2630,7 @@
  3.1217  				q|quit)
  3.1218  					break ;;
  3.1219  				shell)
  3.1220 -					echo "You are already running a Tazpkg SHell." ;;
  3.1221 +					gettext "You are already running a Tazpkg SHell."; echo ;;
  3.1222  				su)
  3.1223  					su -c 'exec tazpkg shell --noheader' && break ;;
  3.1224  				"")
  3.1225 @@ -2645,7 +2668,7 @@
  3.1226  		*.ipk|*.opk)
  3.1227  			convert_ipk;;
  3.1228  		*)
  3.1229 -			echo "Unsupported format";;
  3.1230 +			gettext "Unsupported format"; echo ;;
  3.1231  		esac ;;
  3.1232  	link)
  3.1233  		# link a package from another slitaz installation
  3.1234 @@ -2660,7 +2683,7 @@
  3.1235  			exit 1
  3.1236  		fi
  3.1237  		if [ -e "$INSTALLED/$PACKAGE" ]; then
  3.1238 -			echo "$PACKAGE is already installed."
  3.1239 +			eval_gettext "\$PACKAGE is already installed."; echo
  3.1240  			exit 1
  3.1241  		fi
  3.1242  		ln -s $TARGET_DIR$INSTALLED/$PACKAGE $INSTALLED
  3.1243 @@ -2669,19 +2692,21 @@
  3.1244  		for i in $DEPENDS; do
  3.1245  			[ -e $INSTALLED/$i ] && continue
  3.1246  			MISSING="$MISSING$i "
  3.1247 -			echo "Missing : $i"
  3.1248 +			eval_gettext "Missing : \$i"; echo
  3.1249  		done
  3.1250  		if [ -n "$MISSING" ]; then
  3.1251  			echo ""
  3.1252 -			echo -n "Link all missing dependencies (y/N) ? "; read answer
  3.1253 +			gettext "Link all missing dependencies (y/N) ? "; read answer
  3.1254  			echo ""
  3.1255  			if [ "$answer" = "y" ]; then
  3.1256  				for i in $MISSING; do
  3.1257  					tazpkg link $i $TARGET_DIR
  3.1258  				done
  3.1259  			else
  3.1260 -				echo -e "\nLeaving dependencies for $PACKAGE unsolved."
  3.1261 -				echo -e "The package is installed but will probably not work.\n"
  3.1262 +				echo ""
  3.1263 +				eval_gettext "Leaving dependencies for \$PACKAGE unsolved."; echo
  3.1264 +				gettext "The package is installed but will probably not work."; echo
  3.1265 +				echo ""
  3.1266  			fi
  3.1267  		fi
  3.1268  		. $INSTALLED/$PACKAGE/receipt