tazpkg diff tazpkg-notify @ rev 603

**tazpkg**: add common output functions: action, title, footer; change the way category translate, localized categories can include spaces; implement boldify, emsg & confirm functions from new libtaz; rename log function to log_pkg; fix check_root invocation; fix convert_rpm function; implement plural i18n messages; list-mirror: --text|--txt|--raw|* produces same output; extract: check for errors in final message; list-config --box: do we need it?; repack-config: date/time in receipt in local format; '--help-up' changed to 'help-up' due to error with new libtaz. **tazpkg-box**: add i18n preamble; fix actions. **tazpkg-notify**: implement plural. **Makefile**: support new functions & tazpkg-box. **po/**: Make pot & msgmerge. Add Russian translation. Add Spanish translation for tazpkg-notify (thanks Kevin Fabian Quintero).
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jun 23 00:51:57 2012 +0000 (2012-06-23)
parents 7d8d81c885c3
children 5317ffe7bfbb
line diff
     1.1 --- a/tazpkg-notify	Sun Apr 01 16:48:06 2012 +0100
     1.2 +++ b/tazpkg-notify	Sat Jun 23 00:51:57 2012 +0000
     1.3 @@ -22,7 +22,9 @@
     1.4  db="/var/lib/tazpkg"
     1.5  doc="file:///usr/share/doc/tazpkg/tazpkg.html"
     1.6  installed=$(ls $db/installed | wc -l)
     1.7 -text="$(gettext "Installed packages") <b>$installed</b>"
     1.8 +text="$(eval_ngettext \
     1.9 +		'<b>$installed</b> installed package' \
    1.10 +		'<b>$installed</b> installed packages' $installed)"
    1.11  icon="/usr/share/pixmaps/tazpkg.png"
    1.12  [ -f "$db/packages.list" ] && mtime=$(find $db/packages.list -mtime +10;)
    1.13  [ -f "$db/packages.up" ] && up=$(cat $db/packages.up | wc -l)
    1.14 @@ -30,12 +32,12 @@
    1.15  # Notification icon
    1.16  listen() {
    1.17  	# Manage the I/O redirection from SHell
    1.18 -	rm -f $fifo && mkfifo $fifo		
    1.19 +	rm -f $fifo && mkfifo $fifo
    1.20  	# Attach a file descriptor
    1.21 -	exec 3<> $fifo	
    1.22 +	exec 3<> $fifo
    1.23  	# Notification icon
    1.24  	yad --notification --listen --image=$icon \
    1.25 -		--text="$(gettext "Checking packages lists") - $text" <&3
    1.26 +		--text="$(eval_gettext 'Checking packages lists - $text')" <&3
    1.27  	# Clean-up
    1.28  	rm -f $fifo
    1.29  }
    1.30 @@ -66,8 +68,7 @@
    1.31  		sleep 6
    1.32  		# Missing packages list
    1.33  		if [ ! -f $db/packages.list ]; then
    1.34 -			tooltip=$(eval_gettext \
    1.35 -				"No packages list found - \$text")
    1.36 +			tooltip=$(eval_gettext 'No packages list found - $text')
    1.37  			echo "action:tazweb $panel?recharge" > $fifo
    1.38  			echo "tooltip:$tooltip" > $fifo
    1.39  			echo "icon:tazpkg-up" > $fifo && exit 0
    1.40 @@ -81,14 +82,15 @@
    1.41  		fi
    1.42  		# Available upgrades
    1.43  		if [ "$up" -gt 0 ]; then
    1.44 -			tooltip=$(eval_gettext \
    1.45 -				"There are <b>\$up</b> upgradeable packages")
    1.46 +			tooltip=$(eval_ngettext \
    1.47 +				'There is <b>$up</b> upgradeable package' \
    1.48 +				'There are <b>$up</b> upgradeable packages' $up)
    1.49  			echo "action:tazweb $panel?up" > $fifo
    1.50  			echo "tooltip:$tooltip" > $fifo
    1.51  			echo "icon:tazpkg-up" > $fifo && exit 0
    1.52  		fi
    1.53  		# Nothing to do, close notification
    1.54 -		tooltip=$(eval_gettext "System is up to date - \$text")
    1.55 +		tooltip=$(eval_gettext 'System is up to date - $text')
    1.56  		echo "tooltip:$tooltip" > $fifo
    1.57  		sleep 10
    1.58  		echo "quit" > $fifo ;;