tazpkg diff tazpkg @ rev 388
Improvements: gettextize missing strings and some typos.
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Thu Dec 09 00:53:05 2010 +0100 (2010-12-09) |
parents | 9cf5ea2f246e |
children | a3fd400ab9d2 |
line diff
1.1 --- a/tazpkg Wed Dec 08 18:37:58 2010 +0100 1.2 +++ b/tazpkg Thu Dec 09 00:53:05 2010 +0100 1.3 @@ -76,52 +76,52 @@ 1.4 # Print the usage. 1.5 usage () 1.6 { 1.7 - echo -e "SliTaz package manager - Version: $VERSION\n 1.8 -\033[1mUsage:\033[0m tazpkg [command] [package|dir|pattern|list|cat|--opt] [dir|--opt] 1.9 - tazpkg shell\n 1.10 -\033[1mCommands: \033[0m 1.11 - usage Print this short usage. 1.12 - bugs Show known bugs in packages. 1.13 - list List installed packages on the system by category or all. 1.14 - xhtml-list Create a xHTML list of installed packages. 1.15 - list-mirror List all available packages on the mirror (--diff for new). 1.16 - info Print information about a package. 1.17 - desc Print description of a package (if it exists). 1.18 - list-files List the files installed with a package. 1.19 - list-config List the configuration files. 1.20 - search Search for a package by pattern or name (options: -i|-l|-m). 1.21 - search-pkgname Search on mirror for package having a particular file. 1.22 - search-file Search for file(s) in all installed packages files. 1.23 - install Install a local (*.tazpkg) package (--forced to force). 1.24 - install-list Install all packages from a list of packages. 1.25 - remove Remove the specified package and all installed files. 1.26 - extract Extract a (*.tazpkg) package into a directory. 1.27 - pack Pack an unpacked or prepared package tree. 1.28 - recharge Recharge your packages.list from the mirror. 1.29 - repack Create a package archive from an installed package. 1.30 - repack-config Create a package archive with configuration files. 1.31 - recompress Rebuild a package with the better compression ratio. 1.32 - upgrade Upgrade one or all installed/listed package(s) on the mirror. 1.33 - upgradeable Build upgradeable packages list quickly. 1.34 - block|unblock Block an installed package version or unblock it for upgrade. 1.35 - get Download a package into the current directory. 1.36 - get-install Download and install a package from the mirror. 1.37 - get-install-list Download and install a list of packages from the mirror. 1.38 - check Verify consistency of installed packages. 1.39 - add-flavor Install the flavor list of packages. 1.40 - install-flavor Install the flavor list of packages and remove other ones. 1.41 - set-release Change release and update packages. 1.42 - clean-cache Clean all packages downloaded in cache directory. 1.43 - depends Display dependencies tree. 1.44 - rdepends Display reverse dependencies tree. 1.45 - convert Convert a deb/rpm/tgz/arch package to a slitaz (.tazpkg). 1.46 - link Link a package from another slitaz installation. 1.47 - setup-mirror Change the mirror url configuration. 1.48 - list-undigest List undigest mirrors. 1.49 - remove-undigest Remove an undigest mirror. 1.50 - add-undigest Add an undigest mirror. 1.51 - setup-undigest Update an undigest mirror. 1.52 - reconfigure Replay post install script from package." 1.53 + echo -e "`gettext \"SliTaz package manager - Version\"`: $VERSION 1.54 +\033[1m`gettext \"Usage\"`:\033[0m `gettext \"tazpkg [command] [package|dir|pattern|list|cat|--opt] [dir|--opt]\"` 1.55 + tazpkg shell\n 1.56 +\033[1m`gettext \"Commands\"`: \033[0m 1.57 + usage `gettext \"Print this short usage.\"` 1.58 + bugs `gettext \"Show known bugs in packages.\"` 1.59 + list `gettext \"List installed packages on the system by category or all.\"` 1.60 + xhtml-list `gettext \"Create a xHTML list of installed packages.\"` 1.61 + list-mirror `gettext \"List all available packages on the mirror (--diff for new).\"` 1.62 + info `gettext \"Print information about a package.\"` 1.63 + desc `gettext \"Print description of a package (if it exists).\"` 1.64 + list-files `gettext \"List the files installed with a package.\"` 1.65 + list-config `gettext \"List the configuration files.\"` 1.66 + search `gettext \"Search for a package by pattern or name (options: -i|-l|-m).\"` 1.67 + search-pkgname `gettext \"Search on mirror for package having a particular file.\"` 1.68 + search-file `gettext \"Search for file(s) in all installed packages files.\"` 1.69 + install `gettext \"Install a local (*.tazpkg) package (--forced to force).\"` 1.70 + install-list `gettext \"Install all packages from a list of packages.\"` 1.71 + remove `gettext \"Remove the specified package and all installed files.\"` 1.72 + extract `gettext \"Extract a (*.tazpkg) package into a directory.\"` 1.73 + pack `gettext \"Pack an unpacked or prepared package tree.\"` 1.74 + recharge `gettext \"Recharge your packages.list from the mirror.\"` 1.75 + repack `gettext \"Create a package archive from an installed package.\"` 1.76 + repack-config `gettext \"Create a package archive with configuration files.\"` 1.77 + recompress `gettext \"Rebuild a package with the better compression ratio.\"` 1.78 + upgrade `gettext \"Upgrade one or all installed/listed package(s) on the mirror.\"` 1.79 + upgradeable `gettext \"Build upgradeable packages list quickly.\"` 1.80 + block|unblock `gettext \"Block an installed package version or unblock it for upgrade.\"` 1.81 + get `gettext \"Download a package into the current directory.\"` 1.82 + get-install `gettext \"Download and install a package from the mirror.\"` 1.83 + get-install-list `gettext \"Download and install a list of packages from the mirror.\"` 1.84 + check `gettext \"Verify consistency of installed packages.\"` 1.85 + add-flavor `gettext \"Install the flavor list of packages.\"` 1.86 + install-flavor `gettext \"Install the flavor list of packages and remove other ones.\"` 1.87 + set-release `gettext \"Change release and update packages.\"` 1.88 + clean-cache `gettext \"Clean all packages downloaded in cache directory.\"` 1.89 + depends `gettext \"Display dependencies tree.\"` 1.90 + rdepends `gettext \"Display reverse dependencies tree.\"` 1.91 + convert `gettext \"Convert a deb/rpm/tgz/arch package to a slitaz (.tazpkg).\"` 1.92 + link `gettext \"Link a package from another slitaz installation.\"` 1.93 + setup-mirror `gettext \"Change the mirror url configuration.\"` 1.94 + list-undigest `gettext \"List undigest mirrors.\"` 1.95 + remove-undigest `gettext \"Remove an undigest mirror.\"` 1.96 + add-undigest `gettext \"Add an undigest mirror.\"` 1.97 + setup-undigest `gettext \"Update an undigest mirror.\"` 1.98 + reconfigure `gettext \"Replay post install script from package.\"`" 1.99 } 1.100 1.101 # Status function with color (supported by Ash). 1.102 @@ -130,9 +130,9 @@ 1.103 local CHECK=$? 1.104 echo -en "\\033[70G[ " 1.105 if [ $CHECK = 0 ]; then 1.106 - echo -en "\\033[1;33mOK" 1.107 + echo -en "\\033[1;33m`gettext \"OK\"`" 1.108 else 1.109 - echo -en "\\033[1;31mFailed" 1.110 + echo -en "\\033[1;31m`gettext \"Failed\"`" 1.111 fi 1.112 echo -e "\\033[0;39m ]" 1.113 return $CHECK 1.114 @@ -142,6 +142,7 @@ 1.115 check_root() 1.116 { 1.117 if test $(id -u) != 0 ; then 1.118 + echo 1.119 gettext \ 1.120 "You must be root to run tazpkg with this option. Please use the command: 1.121 su followed by the root password to become super-user."; echo 1.122 @@ -398,7 +399,7 @@ 1.123 # Extract a package with cpio and gzip/lzma. 1.124 extract_package() 1.125 { 1.126 - gettext "Extracting $PACKAGE... " 1.127 + eval_gettext "Extracting \$PACKAGE... " 1.128 cpio -idm --quiet < $PACKAGE.tazpkg && rm -f $PACKAGE.tazpkg 1.129 status 1.130 if [ -f fs.cpio.lzma ]; then 1.131 @@ -684,13 +685,15 @@ 1.132 root="" 1.133 [ -n "$1" ] && root="--root=$1" 1.134 if [ "$AUTO_INSTALL_DEPS" == "yes" ]; then 1.135 - anser="y" 1.136 + answer="y" 1.137 else 1.138 echo "" 1.139 - gettext "Install all missing dependencies (y/N) ? "; read anser 1.140 + gettext "Install all missing dependencies" 1.141 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.142 + read answer 1.143 echo "" 1.144 fi 1.145 - if [ "$anser" == "y" ]; then 1.146 + if [ "$answer" == "$(translate_querry y)" ]; then 1.147 for pkgorg in $DEPENDS 1.148 do 1.149 pkg=$(equivalent_pkg $pkgorg $1) 1.150 @@ -816,7 +819,7 @@ 1.151 . $INSTALLED/$pkg/receipt 1.152 echo -n "$PACKAGE " 1.153 echo -en "\033[24G $VERSION$EXTRAVERSION" 1.154 - echo -e "\033[42G $CATEGORY" 1.155 + echo -e "\033[42G `translate_category $CATEGORY`." 1.156 packages=$(($packages+1)) 1.157 done 1.158 # Set correct ending messages. 1.159 @@ -1079,9 +1082,9 @@ 1.160 show_unresolved_lib() 1.161 { 1.162 if [ -s $TMP_DIR/unresolved ]; then 1.163 - echo "BUGS=\"No dependency for" >> $1 1.164 + echo -e "BUGS=\"`gettext \"No dependency for\"`" >> $1 1.165 cat $TMP_DIR/unresolved | sort | uniq | while read file; do 1.166 - echo -e "$WARNING: unknown dependency for $lib" 1.167 + eval_gettext "WARNING: unknown dependency for \$lib"; echo 1.168 echo -n " $file" >> $1 1.169 done 1.170 echo "\"" >> $1 1.171 @@ -1356,6 +1359,71 @@ 1.172 fi 1.173 } 1.174 1.175 +translate_category() 1.176 +{ 1.177 + case $1 in 1.178 + base-system) gettext "base-system" ;; 1.179 + x-window) gettext "x-window" ;; 1.180 + utilities) gettext "utilities" ;; 1.181 + network) gettext "network" ;; 1.182 + graphics) gettext "graphics" ;; 1.183 + multimedia) gettext "multimedia" ;; 1.184 + office) gettext "office" ;; 1.185 + development) gettext "development" ;; 1.186 + system-tools) gettext "system-tools" ;; 1.187 + security) gettext "security" ;; 1.188 + games) gettext "games" ;; 1.189 + misc) gettext "misc" ;; 1.190 + meta) gettext "meta" ;; 1.191 + non-free) gettext "non-free" ;; 1.192 + 1.193 + # Support custom categories by keeping them untranslated. 1.194 + *) echo "$1" ;; 1.195 + 1.196 + esac 1.197 +} 1.198 + 1.199 +reverse_translate_category() 1.200 +{ 1.201 + case $1 in 1.202 + `gettext "base-system"`) echo "base-system" ;; 1.203 + `gettext "x-window"`) echo "x-window" ;; 1.204 + `gettext "utilities"`) echo "utilities" ;; 1.205 + `gettext "network"`) echo "network" ;; 1.206 + `gettext "graphics"`) echo "graphics" ;; 1.207 + `gettext "multimedia"`) echo "multimedia" ;; 1.208 + `gettext "office"`) echo "office" ;; 1.209 + `gettext "development"`) echo "development" ;; 1.210 + `gettext "system-tools"`) echo "system-tools" ;; 1.211 + `gettext "security"`) echo "security" ;; 1.212 + `gettext "games"`) echo "games" ;; 1.213 + `gettext "misc"`) echo "misc" ;; 1.214 + `gettext "meta"`) echo "meta" ;; 1.215 + `gettext "non-free"`) echo "non-free" ;; 1.216 + 1.217 + # If gategory isn't one of thoses traduced in native language, 1.218 + # keep it untranslated. This allow both native and english 1.219 + # language support. This also support custom categories. 1.220 + *) echo "$1" ;; 1.221 + 1.222 + esac 1.223 +} 1.224 + 1.225 +translate_querry() 1.226 +{ 1.227 + case $1 in 1.228 + y) gettext "y" ;; 1.229 + Y) gettext "Y" ;; 1.230 + n) gettext "n" ;; 1.231 + N) gettext "N" ;; 1.232 + 1.233 + # Support other cases but keep them untranslated. 1.234 + *) echo "$1" ;; 1.235 + 1.236 + esac 1.237 +} 1.238 + 1.239 + 1.240 ################### 1.241 # Tazpkg commands # 1.242 ################### 1.243 @@ -1371,7 +1439,7 @@ 1.244 if [ -s "$BLOCKED" ];then 1.245 cat $BLOCKED 1.246 else 1.247 - gettext "No blocked packages found." 1.248 + gettext "No blocked packages found."; echo 1.249 fi 1.250 echo "" && exit 0 1.251 fi 1.252 @@ -1382,19 +1450,20 @@ 1.253 echo "================================================================================" 1.254 for i in $CATEGORIES 1.255 do 1.256 - echo $i 1.257 + translate_category $i; echo 1.258 categories=$(($categories+1)) 1.259 done 1.260 echo "================================================================================" 1.261 - echo "$categories categories" 1.262 + eval_gettext "\$categories categories"; echo 1.263 echo "" 1.264 exit 0 1.265 fi 1.266 # Check for an asked category. 1.267 if [ -n "$2" ]; then 1.268 - ASKED_CATEGORY=$2 1.269 + ASKED_CATEGORY_I18N=$2 1.270 + ASKED_CATEGORY=$(reverse_translate_category $2) 1.271 echo "" 1.272 - echo -e "\033[1m`gettext \"Installed packages of category:\"`\033[0m $ASKED_CATEGORY" 1.273 + echo -e "\033[1m`gettext \"Installed packages of category:\"`\033[0m $ASKED_CATEGORY_I18N" 1.274 echo "================================================================================" 1.275 for pkg in $INSTALLED/* 1.276 do 1.277 @@ -1408,7 +1477,7 @@ 1.278 fi 1.279 done 1.280 echo "================================================================================" 1.281 - eval_gettext "\$packages packages installed of category \$ASKED_CATEGORY."; echo 1.282 + eval_gettext "\$packages packages installed of category \$ASKED_CATEGORY_I18N."; echo 1.283 echo "" 1.284 else 1.285 # By default list all packages and versions. 1.286 @@ -1422,7 +1491,7 @@ 1.287 . $pkg/receipt 1.288 echo -n "$PACKAGE" 1.289 echo -en "\033[24G $VERSION$EXTRAVERSION" 1.290 - echo -e "\033[42G $CATEGORY" 1.291 + echo -e "\033[42G `translate_category $CATEGORY`" 1.292 packages=$(($packages+1)) 1.293 done 1.294 echo "================================================================================" 1.295 @@ -1509,7 +1578,7 @@ 1.296 cat $INSTALLED/$PACKAGE/files.list | sort 1.297 echo "================================================================================" 1.298 files=`cat $INSTALLED/$PACKAGE/files.list | wc -l` 1.299 - echo "$files files installed with $PACKAGE." 1.300 + eval_gettext "\$files files installed with \$PACKAGE."; echo 1.301 echo "" ;; 1.302 info) 1.303 # Information about package. 1.304 @@ -1521,25 +1590,25 @@ 1.305 echo "" 1.306 echo -e "\033[1m`gettext \"Tazpkg information\"`\033[0m 1.307 ================================================================================ 1.308 -Package : $PACKAGE 1.309 -Version : $VERSION$EXTRAVERSION 1.310 -Category : $CATEGORY 1.311 -Short desc : $SHORT_DESC 1.312 -Maintainer : $MAINTAINER" 1.313 - if [ ! "$DEPENDS" = "" ]; then 1.314 - echo -e "Depends : $DEPENDS" 1.315 +`gettext \"Package :\"` $PACKAGE 1.316 +`gettext \"Version :\"` $VERSION$EXTRAVERSION 1.317 +`gettext \"Category :\"` `translate_category $CATEGORY` 1.318 +`gettext \"Short desc :\"` $SHORT_DESC 1.319 +`gettext \"Maintainer :\"` $MAINTAINER" 1.320 + if [ "$DEPENDS" ]; then 1.321 + echo -e "`gettext \"Depends :\"` $DEPENDS" 1.322 fi 1.323 - if [ ! "$SUGGESTED" = "" ]; then 1.324 - echo -e "Suggested : $SUGGESTED" 1.325 + if [ "$SUGGESTED" ]; then 1.326 + echo -e "`gettext \"Suggested :\"` $SUGGESTED" 1.327 fi 1.328 - if [ ! "$BUILD_DEPENDS" = "" ]; then 1.329 - echo -e "Build deps : $BUILD_DEPENDS" 1.330 + if [ "$BUILD_DEPENDS" ]; then 1.331 + echo -e "`gettext \"Build deps :\"` $BUILD_DEPENDS" 1.332 fi 1.333 - if [ ! "$WANTED" = "" ]; then 1.334 - echo -e "Wanted src : $WANTED" 1.335 + if [ "$WANTED" ]; then 1.336 + echo -e "`gettext \"Wanted src :\"` $WANTED" 1.337 fi 1.338 - if [ ! "$WEB_SITE" = "" ]; then 1.339 - echo -e "Web site : $WEB_SITE" 1.340 + if [ "$WEB_SITE" ]; then 1.341 + echo -e "`gettext \"Web site :\"` $WEB_SITE" 1.342 fi 1.343 echo "================================================================================" 1.344 echo "" ;; 1.345 @@ -1701,7 +1770,7 @@ 1.346 INSTALL_LIST="${3#--list=}" 1.347 ;; 1.348 *) shift 2 1.349 - echo -e "\nUnknown option $*.\n" 1.350 + echo -e "\n`gettext \"Unknow option\"` $*.\n" >&2 1.351 exit 1 1.352 ;; 1.353 esac 1.354 @@ -1750,7 +1819,7 @@ 1.355 slitaz-base-files tazpkg ; do 1.356 pkg=$(egrep $pkg-[0-9] $INSTALL_LIST) 1.357 [ -n "$pkg" ] || continue 1.358 - echo "Adding implicit depends $pkg ..." 1.359 + eval_gettext "Adding implicit depends \$pkg ..."; echo 1.360 LIST="$pkg 1.361 $LIST" 1.362 done 1.363 @@ -1810,7 +1879,7 @@ 1.364 fi 1.365 ;; 1.366 *) shift 2 1.367 - echo -e "\nUnknown option $*.\n" 1.368 + echo -e "\n`gettext \"Unknow option\"` $*.\n" >&2 1.369 exit 1 1.370 ;; 1.371 esac 1.372 @@ -1849,8 +1918,9 @@ 1.373 done 1.374 fi 1.375 eval_gettext "Remove \$PACKAGE (\$VERSION\$EXTRAVERSION) ?"; echo 1.376 - gettext "Please confirm uninstallation (y/N) : "; read anser 1.377 - if [ "$anser" = "y" ]; then 1.378 + gettext "Please confirm uninstallation" 1.379 + echo -n " (`translate_querry y`/`translate_querry N`) : "; read answer 1.380 + if [ "$answer" = "$(translate_querry y)" ]; then 1.381 echo "" 1.382 echo -e "\033[1m`gettext \"Removing:\"`\033[0m $PACKAGE" 1.383 echo "================================================================================" 1.384 @@ -1888,8 +1958,9 @@ 1.385 log Removed 1.386 if [ -n "$ALTERED" ]; then 1.387 eval_gettext "Remove packages depending on \$PACKAGE" 1.388 - echo -n " (y/N) ? "; read anser 1.389 - if [ "$anser" = "y" ]; then 1.390 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.391 + read answer 1.392 + if [ "$answer" = "$(translate_querry y)" ]; then 1.393 for i in $ALTERED; do 1.394 if [ -d "$ROOT$INSTALLED/$i" ]; then 1.395 tazpkg remove $i $ROOTOPTS 1.396 @@ -1899,8 +1970,9 @@ 1.397 fi 1.398 if [ -n "$REFRESH" ]; then 1.399 eval_gettext "Reinstall packages modified by \$PACKAGE" 1.400 - echo -n " (y/N) ? "; read anser 1.401 - if [ "$anser" = "y" ]; then 1.402 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.403 + read answer 1.404 + if [ "$answer" = "$(translate_querry y)" ]; then 1.405 for i in $REFRESH; do 1.406 if [ $(wc -l < $ROOT$INSTALLED/$i) -gt 1 ]; then 1.407 eval_gettext "Check \$INSTALLED/\$i for reinstallation"; echo 1.408 @@ -1977,7 +2049,7 @@ 1.409 zcat $i | cpio -idm --quiet > /dev/null 1.410 find * -type f 2>/dev/null | while read file; do 1.411 if [ ! -e /$file ]; then 1.412 - echo -n "|--|--|--|File lost" 1.413 + echo -en "|--|--|--|`gettext \"File lost\"`" 1.414 else 1.415 echo -n "$(stat -c "%A|%U|%G|%s|" /$file)" 1.416 cmp $file /$file > /dev/null 2>&1 || \ 1.417 @@ -1991,7 +2063,7 @@ 1.418 rm -rf $TMP_DIR 1.419 else 1.420 echo "" 1.421 - echo -e "\033[1m`gettext \"Configuration files\"`" 1.422 + echo -e "\033[1m`gettext \"Configuration files\"`\033[0m" 1.423 echo "================================================================================" 1.424 for i in $INSTALLED/*/volatile.cpio.gz; do 1.425 [ -n "$2" -a "$i" != "$INSTALLED/$2/volatile.cpio.gz" ] && continue 1.426 @@ -2028,7 +2100,7 @@ 1.427 PACKAGE="config" 1.428 VERSION="$CONFIG_VERSION" 1.429 CATEGORY="base-system" 1.430 -SHORT_DESC="User configuration backup on $(date)" 1.431 +SHORT_DESC="$(gettext "User configuration backup on ")$(date)" 1.432 DEPENDS="$(ls $INSTALLED)" 1.433 EOT 1.434 cd .. 1.435 @@ -2048,7 +2120,7 @@ 1.436 echo -e "\033[1mRepacking :\033[0m $PACKAGE-$VERSION$EXTRAVERSION.tazpkg" 1.437 echo "================================================================================" 1.438 if grep -qs ^NO_REPACK= $INSTALLED/$PACKAGE/receipt; then 1.439 - echo "Can't repack $PACKAGE" 1.440 + eval_gettext "Can't repack \$PACKAGE"; echo 1.441 exit 1 1.442 fi 1.443 if [ -s $INSTALLED/$PACKAGE/modifiers ]; then 1.444 @@ -2091,7 +2163,7 @@ 1.445 if [ -f $INSTALLED/$PACKAGE/md5sum ]; then 1.446 sed 's, , fs,' < $INSTALLED/$PACKAGE/md5sum | \ 1.447 md5sum -s -c || { 1.448 - echo "Can't repack, md5sum error." 1.449 + gettext "Can't repack, md5sum error."; echo 1.450 cd $TOP_DIR 1.451 rm -rf $TMP_DIR 1.452 exit 1 1.453 @@ -2103,7 +2175,7 @@ 1.454 cd $TOP_DIR 1.455 \rm -R $TMP_DIR 1.456 eval_gettext "Package \$PACKAGE repacked successfully."; echo 1.457 - echo "Size : `du -sh $PACKAGE-$VERSION$EXTRAVERSION.tazpkg`" 1.458 + echo -e "`gettext \"Size\"` : `du -sh $PACKAGE-$VERSION$EXTRAVERSION.tazpkg`" 1.459 echo "" ;; 1.460 pack) 1.461 # Create SliTaz package archive using cpio and gzip. 1.462 @@ -2158,7 +2230,7 @@ 1.463 rm fs.cpio.lzma && cd .. 1.464 echo "================================================================================" 1.465 eval_gettext "Package \$PACKAGE compressed successfully."; echo 1.466 - echo "Size : `du -sh $PACKAGE.tazpkg`" 1.467 + echo "`gettext \"Size\"` : `du -sh $PACKAGE.tazpkg`" 1.468 echo "" 1.469 fi ;; 1.470 recharge) 1.471 @@ -2170,7 +2242,7 @@ 1.472 [ -f $path/mirror ] || continue 1.473 echo "" 1.474 if [ "$path" != "$LOCALSTATE" ]; then 1.475 - echo "Recharging undigest $(basename $path):" 1.476 + echo -e "`gettext \"Recharging undigest\"` $(basename $path):" 1.477 fi 1.478 cd $path 1.479 if [ -f "packages.list" ]; then 1.480 @@ -2296,7 +2368,7 @@ 1.481 current_md5=$(grep -s " $PACKAGE-$VERSION" installed.md5 | awk '{ print $1 }') 1.482 new_md5=$(grep -hs " $PACKAGE-$VERSION" packages.md5 undigest/*/packages.md5 | head -1 | awk '{ print $1 }') 1.483 [ -n "$current_md5" ] && [ -n "$new_md5" ] && 1.484 - [ "$current_md5" != "$new_md5" ] && RELEASE=build 1.485 + [ "$current_md5" != "$new_md5" ] && RELEASE=$(gettext "build") 1.486 fi 1.487 if [ "$VERSION" != "$NEW_VERSION" -o -n "$RELEASE" ]; then 1.488 # Version seems different. Check for major, minor or 1.489 @@ -2307,30 +2379,30 @@ 1.490 NEW_MINOR=`echo ${NEW_VERSION%_*} | cut -f2 -d"."` 1.491 # Minor 1.492 if [ "$NEW_MINOR" -gt "$PKG_MINOR" ] 2> /dev/null; then 1.493 - RELEASE=minor 1.494 + RELEASE=$(gettext "minor") 1.495 fi 1.496 if [ "$NEW_MINOR" -lt "$PKG_MINOR" ] 2> /dev/null; then 1.497 - RELEASE=$WARNING 1.498 + RELEASE=$(gettext "WARNING") 1.499 FIXE=yes 1.500 fi 1.501 # Major 1.502 if [ "$NEW_MAJOR" -gt "$PKG_MAJOR" ] 2> /dev/null; then 1.503 - RELEASE=major 1.504 + RELEASE=$(gettext "major") 1.505 FIXE="" 1.506 fi 1.507 if [ "$NEW_MAJOR" -lt "$PKG_MAJOR" ] 2> /dev/null; then 1.508 - RELEASE=WARNING 1.509 + RELEASE=$(gettext "WARNING") 1.510 FIXE=yes 1.511 fi 1.512 # Default to revision. 1.513 if [ -z $RELEASE ]; then 1.514 - RELEASE=revision 1.515 + RELEASE=$(gettext "revision") 1.516 fi 1.517 # Pkg name is already displayed by the check process. 1.518 echo -en "\033[24G $VERSION" 1.519 echo -en "\033[38G --->" 1.520 echo -en "\033[43G $NEW_VERSION" 1.521 - echo -en "\033[58G $CATEGORY" 1.522 + echo -en "\033[58G `translate_category $CATEGORY`" 1.523 echo -e "\033[72G $RELEASE" 1.524 up=$(($up+1)) 1.525 echo "$PACKAGE" >> upgradeable-packages.list 1.526 @@ -2369,14 +2441,16 @@ 1.527 echo "" 1.528 fi 1.529 # Ask for upgrade, it can be done another time. 1.530 - echo -n "Upgrade now (y/N) ? "; read anser 1.531 - if [ ! "$anser" = "y" ]; then 1.532 + gettext "Upgrade now" 1.533 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.534 + read answer 1.535 + if [ ! "$answer" = "$(translate_querry y)" ]; then 1.536 echo "" 1.537 gettext "Exiting. No package upgraded."; echo 1.538 echo "" 1.539 exit 0 1.540 fi 1.541 - # If anser is yes (y). Install all new versions. 1.542 + # If answer is yes (y). Install all new versions. 1.543 cat upgradeable-packages.list >> upgradeable-packages.list$$ 1.544 mv -f upgradeable-packages.list$$ upgradeable-packages.list 1.545 yes y | tazpkg get-install-list upgradeable-packages.list --forced 1.546 @@ -2389,13 +2463,13 @@ 1.547 shift 1.548 LIST=$@ 1.549 [ -n "$LIST" ] || LIST=`ls` 1.550 - MSG=`gettext "No known bugs."` 1.551 + MSG=$(gettext "No known bugs.") 1.552 for PACKAGE in $LIST; do 1.553 BUGS="" 1.554 EXTRAVERSION="" 1.555 . $PACKAGE/receipt 1.556 if [ -n "$BUGS" ]; then 1.557 - MSG=`gettext "Bug list completed"` 1.558 + MSG=$(gettext "Bug list completed") 1.559 echo "" 1.560 eval_gettext "Bugs in package \$PACKAGE version \$VERSION\$EXTRAVERSION:"; echo 1.561 cat <<EOT 1.562 @@ -2428,27 +2502,27 @@ 1.563 echo " $i" 1.564 done 1.565 fi 1.566 - MSG="Files lost from $PACKAGE $VERSION$EXTRAVERSION :\n" 1.567 + MSG="$(eval_gettext "Files lost from \$PACKAGE \$VERSION\$EXTRAVERSION :")\n" 1.568 while read file; do 1.569 [ -e "$file" ] && continue 1.570 if [ -L "$file" ]; then 1.571 - MSG="$MSG target of symlink" 1.572 + MSG="$MSG $(gettext "target of symlink")" 1.573 fi 1.574 echo -e "$MSG $file" 1.575 MSG="" 1.576 done < $PACKAGE/files.list 1.577 - MSG="Missing dependencies for $PACKAGE $VERSION$EXTRAVERSION :\n" 1.578 + MSG="$(gettext "Missing dependencies for") $PACKAGE $VERSION$EXTRAVERSION :\n" 1.579 for i in $DEPENDS; do 1.580 [ -d $i ] && continue 1.581 [ -d $(equivalent_pkg $i) ] && continue 1.582 echo -e "$MSG $i" 1.583 MSG="" 1.584 done 1.585 - MSG="Dependencies loop between $PACKAGE and :\n" 1.586 + MSG="$(gettext "Dependencies loop between") $PACKAGE and :\n" 1.587 ALL_DEPS="" 1.588 check_for_deps_loop $PACKAGE $DEPENDS 1.589 done 1.590 - echo -n "Looking for known bugs... " 1.591 + gettext "Looking for known bugs... "; echo 1.592 tazpkg bugs 1.593 if [ "$PACKAGE_FILE" = "--full" ]; then 1.594 for file in */md5sum; do 1.595 @@ -2473,18 +2547,18 @@ 1.596 [ $(grep "^$(echo $file | grepesc)$" */files.list 2> /dev/null | \ 1.597 wc -l) -gt 1 ] || continue 1.598 FILES="$FILES$file " 1.599 - echo "The following packages provide $file :" 1.600 + eval_gettext "The following packages provide \$file :"; echo 1.601 grep -l "^$(echo $file | grepesc)$" */files.list | while read f 1.602 do 1.603 pkg=${f%/files.list} 1.604 echo -n " $pkg" 1.605 if [ -f $pkg/modifiers ]; then 1.606 - echo -n " (overridden by $(echo "$(cat $pkg/modifiers)"))" 1.607 + echo -en " (`gettext \"overridden by\"`) $(echo "$(cat $pkg/modifiers)"))" 1.608 fi 1.609 echo "" 1.610 done 1.611 done 1.612 - MSG="No package has installed the following files:\n" 1.613 + MSG="$(gettext "No package has installed the following files"):\n" 1.614 find /etc /bin /sbin /lib /usr /var/www \ 1.615 -not -type d 2> /dev/null | while read file; do 1.616 case "$file" in *\[*) continue;; esac 1.617 @@ -2493,7 +2567,7 @@ 1.618 MSG="" 1.619 done 1.620 fi 1.621 - echo "Check completed." ;; 1.622 + gettext "Check completed."; echo ;; 1.623 block) 1.624 # Add a pkg name to the list of blocked packages. 1.625 # 1.626 @@ -2528,7 +2602,7 @@ 1.627 . $INSTALLED/$PACKAGE/receipt 1.628 log Unblocked 1.629 else 1.630 - eval_gettext "\$PACKAGE is not in the blocked packages list." 1.631 + eval_gettext "\$PACKAGE is not in the blocked packages list."; echo 1.632 echo "" 1.633 exit 0 1.634 fi 1.635 @@ -2576,7 +2650,7 @@ 1.636 INSTALL_LIST="${3#--list=}" 1.637 ;; 1.638 *) shift 2 1.639 - echo -e "\nUnknown option $*.\n" 1.640 + echo -e "\n`gettext \"Unknow option\"` $*.\n" >&2 1.641 exit 1 1.642 ;; 1.643 esac 1.644 @@ -2600,7 +2674,7 @@ 1.645 fi 1.646 cd $CACHE_DIR 1.647 if [ -f "$PACKAGE.tazpkg" ]; then 1.648 - echo "$PACKAGE already in the cache : $CACHE_DIR" 1.649 + eval_gettext "\$PACKAGE already in the cache : \$CACHE_DIR"; echo 1.650 # Check package download was finished 1.651 tail -c 2k $PACKAGE.tazpkg | grep -q 00000000TRAILER || { 1.652 eval_gettext "Continuing \$PACKAGE download"; echo 1.653 @@ -2627,7 +2701,7 @@ 1.654 echo "" 1.655 echo -e "\033[1m`gettext \"Clean cache:\"`\033[0m $CACHE_DIR" 1.656 echo "================================================================================" 1.657 - gettext "Cleaning cache directory..." 1.658 + gettext "Cleaning cache directory..."; echo 1.659 rm -rf $CACHE_DIR/* 1.660 status 1.661 echo "================================================================================" 1.662 @@ -2658,16 +2732,19 @@ 1.663 # remove undigest URL. 1.664 # 1.665 check_root 1.666 + undigest="$2" 1.667 if [ -d $LOCALSTATE/undigest/$2 ]; then 1.668 - echo -n "Remove $2 undigest (y/N) ? "; read anser 1.669 - if [ "$anser" = "y" ]; then 1.670 - echo -n "Removing $2 undigest..." 1.671 + eval_gettext "Remove \$undigest undigest" 1.672 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.673 + read answer 1.674 + if [ "$answer" = "$(translate_querry y)" ]; then 1.675 + eval_gettext "Removing \$undigest undigest..." 1.676 rm -rf $LOCALSTATE/undigest/$2 1.677 status 1.678 rmdir $LOCALSTATE/undigest 2> /dev/null 1.679 fi 1.680 else 1.681 - echo "Undigest $2 not found" 1.682 + eval_gettext "Undigest \$undigest not found"; echo 1.683 fi ;; 1.684 add-undigest|setup-undigest) 1.685 # Add undigest URL. 1.686 @@ -2703,7 +2780,7 @@ 1.687 --root=*) 1.688 ROOT="${3#--root=}/" ;; 1.689 *) shift 2 1.690 - echo -e "\nUnknown option $*.\n" 1.691 + echo -e "\n`gettext \"Unknow option\"` $*.\n" >&2 1.692 exit 1 ;; 1.693 esac 1.694 shift 1.695 @@ -2737,7 +2814,7 @@ 1.696 if [ ! "$2" = "--noheader" ]; then 1.697 clear 1.698 echo "" 1.699 - echo -e "\033[1mTazpkg SHell.\033[0m" 1.700 + echo -e "\033[1m`gettext \"Tazpkg SHell\"`.\033[0m" 1.701 echo "================================================================================" 1.702 gettext "Type 'usage' to list all available commands or 'quit' or 'q' to exit."; echo 1.703 echo "" 1.704 @@ -2815,9 +2892,11 @@ 1.705 done 1.706 if [ -n "$MISSING" ]; then 1.707 echo "" 1.708 - gettext "Link all missing dependencies (y/N) ? "; read answer 1.709 + gettext "Link all missing dependencies" 1.710 + echo -n " (`translate_querry y`/`translate_querry N`) ? " 1.711 + read answer 1.712 echo "" 1.713 - if [ "$answer" = "y" ]; then 1.714 + if [ "$answer" = "$(translate_querry y)" ]; then 1.715 for i in $MISSING; do 1.716 tazpkg link $i $TARGET_DIR 1.717 done