slitaz-base-files rev 287

libtaz.sh: change pair of functions: action(), status() to best look in textual logs and in gtk boxes
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Nov 21 17:50:14 2015 +0200 (2015-11-21)
parents af25e2951d08
children 973c3b2ecc5a
files po/el.po po/es.po po/fa.po po/fr.po po/pl.po po/pt_BR.po po/ru.po po/slitaz-base.pot po/sv.po po/zh_CN.po po/zh_TW.po rootfs/lib/libtaz.sh
line diff
     1.1 --- a/po/el.po	Thu Oct 08 00:32:28 2015 +0300
     1.2 +++ b/po/el.po	Sat Nov 21 17:50:14 2015 +0200
     1.3 @@ -46,6 +46,10 @@
     1.4  msgid "N"
     1.5  msgstr "N"
     1.6  
     1.7 +#: rootfs/lib/libtaz.sh:221
     1.8 +msgid "w"
     1.9 +msgstr "16"
    1.10 +
    1.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    1.12  msgid "Mirror is unreachable"
    1.13  msgstr "O καθρέπτης (mirror) είναι απρόσιτoς"
     2.1 --- a/po/es.po	Thu Oct 08 00:32:28 2015 +0300
     2.2 +++ b/po/es.po	Sat Nov 21 17:50:14 2015 +0200
     2.3 @@ -44,6 +44,10 @@
     2.4  msgid "N"
     2.5  msgstr "N"
     2.6  
     2.7 +#: rootfs/lib/libtaz.sh:221
     2.8 +msgid "w"
     2.9 +msgstr "9"
    2.10 +
    2.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    2.12  msgid "Mirror is unreachable"
    2.13  msgstr "No se puede alcanzar el Mirror"
     3.1 --- a/po/fa.po	Thu Oct 08 00:32:28 2015 +0300
     3.2 +++ b/po/fa.po	Sat Nov 21 17:50:14 2015 +0200
     3.3 @@ -47,6 +47,10 @@
     3.4  msgid "N"
     3.5  msgstr "N"
     3.6  
     3.7 +#: rootfs/lib/libtaz.sh:221
     3.8 +msgid "w"
     3.9 +msgstr "14"
    3.10 +
    3.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    3.12  msgid "Mirror is unreachable"
    3.13  msgstr "آیینه در دسترس نیست"
     4.1 --- a/po/fr.po	Thu Oct 08 00:32:28 2015 +0300
     4.2 +++ b/po/fr.po	Sat Nov 21 17:50:14 2015 +0200
     4.3 @@ -45,6 +45,10 @@
     4.4  msgid "N"
     4.5  msgstr "N"
     4.6  
     4.7 +#: rootfs/lib/libtaz.sh:221
     4.8 +msgid "w"
     4.9 +msgstr "9"
    4.10 +
    4.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    4.12  msgid "Mirror is unreachable"
    4.13  msgstr "Le miroir est inacessible"
     5.1 --- a/po/pl.po	Thu Oct 08 00:32:28 2015 +0300
     5.2 +++ b/po/pl.po	Sat Nov 21 17:50:14 2015 +0200
     5.3 @@ -49,6 +49,10 @@
     5.4  msgid "N"
     5.5  msgstr "N"
     5.6  
     5.7 +#: rootfs/lib/libtaz.sh:221
     5.8 +msgid "w"
     5.9 +msgstr "17"
    5.10 +
    5.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    5.12  msgid "Mirror is unreachable"
    5.13  msgstr "Serwer lustrzany jest nieosiągalny"
     6.1 --- a/po/pt_BR.po	Thu Oct 08 00:32:28 2015 +0300
     6.2 +++ b/po/pt_BR.po	Sat Nov 21 17:50:14 2015 +0200
     6.3 @@ -45,6 +45,10 @@
     6.4  msgid "N"
     6.5  msgstr "N"
     6.6  
     6.7 +#: rootfs/lib/libtaz.sh:221
     6.8 +msgid "w"
     6.9 +msgstr "13"
    6.10 +
    6.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    6.12  msgid "Mirror is unreachable"
    6.13  msgstr "Mirror indisponível"
     7.1 --- a/po/ru.po	Thu Oct 08 00:32:28 2015 +0300
     7.2 +++ b/po/ru.po	Sat Nov 21 17:50:14 2015 +0200
     7.3 @@ -47,6 +47,10 @@
     7.4  msgid "N"
     7.5  msgstr "N"
     7.6  
     7.7 +#: rootfs/lib/libtaz.sh:221
     7.8 +msgid "w"
     7.9 +msgstr "10"
    7.10 +
    7.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    7.12  msgid "Mirror is unreachable"
    7.13  msgstr "Репозиторий недоступен"
     8.1 --- a/po/slitaz-base.pot	Thu Oct 08 00:32:28 2015 +0300
     8.2 +++ b/po/slitaz-base.pot	Sat Nov 21 17:50:14 2015 +0200
     8.3 @@ -45,6 +45,10 @@
     8.4  msgid "N"
     8.5  msgstr ""
     8.6  
     8.7 +#: rootfs/lib/libtaz.sh:221
     8.8 +msgid "w"
     8.9 +msgstr ""
    8.10 +
    8.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    8.12  msgid "Mirror is unreachable"
    8.13  msgstr ""
     9.1 --- a/po/sv.po	Thu Oct 08 00:32:28 2015 +0300
     9.2 +++ b/po/sv.po	Sat Nov 21 17:50:14 2015 +0200
     9.3 @@ -45,6 +45,10 @@
     9.4  msgid "N"
     9.5  msgstr "N"
     9.6  
     9.7 +#: rootfs/lib/libtaz.sh:221
     9.8 +msgid "w"
     9.9 +msgstr "8"
    9.10 +
    9.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
    9.12  msgid "Mirror is unreachable"
    9.13  msgstr "Spegeln går inte att nå"
    10.1 --- a/po/zh_CN.po	Thu Oct 08 00:32:28 2015 +0300
    10.2 +++ b/po/zh_CN.po	Sat Nov 21 17:50:14 2015 +0200
    10.3 @@ -46,6 +46,10 @@
    10.4  msgid "N"
    10.5  msgstr "否"
    10.6  
    10.7 +#: rootfs/lib/libtaz.sh:221
    10.8 +msgid "w"
    10.9 +msgstr "8"
   10.10 +
   10.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
   10.12  msgid "Mirror is unreachable"
   10.13  msgstr "无法连接镜像"
    11.1 --- a/po/zh_TW.po	Thu Oct 08 00:32:28 2015 +0300
    11.2 +++ b/po/zh_TW.po	Sat Nov 21 17:50:14 2015 +0200
    11.3 @@ -44,6 +44,10 @@
    11.4  msgid "N"
    11.5  msgstr "否"
    11.6  
    11.7 +#: rootfs/lib/libtaz.sh:221
    11.8 +msgid "w"
    11.9 +msgstr "8"
   11.10 +
   11.11  #: rootfs/usr/lib/slitaz/libpkg.sh:33
   11.12  msgid "Mirror is unreachable"
   11.13  msgstr "無法連接鏡像"
    12.1 --- a/rootfs/lib/libtaz.sh	Thu Oct 08 00:32:28 2015 +0300
    12.2 +++ b/rootfs/lib/libtaz.sh	Sat Nov 21 17:50:14 2015 +0200
    12.3 @@ -61,10 +61,8 @@
    12.4  			 done=" <span class=\"float-right color$okcolor\">$okmsg</span>"
    12.5  			error=" <span class=\"float-right color$ercolor\">$ermsg</span>";;
    12.6  		*)
    12.7 -			local cols=$(get_cols)
    12.8 -			local scol=$((${cols:-80} - 10))
    12.9 -			 done="\\033[${scol}G[ \\033[1;${okcolor}m${okmsg}\\033[0;39m ]"
   12.10 -			error="\\033[${scol}G[ \\033[1;${ercolor}m${ermsg}\\033[0;39m ]";;
   12.11 +			 done="[ \\033[1;${okcolor}m${okmsg}\\033[0;39m ]"
   12.12 +			error="[ \\033[1;${ercolor}m${ermsg}\\033[0;39m ]";;
   12.13  	esac
   12.14  	case $check in
   12.15  		0) echo -e "$done";;
   12.16 @@ -219,9 +217,16 @@
   12.17  
   12.18  # Print current action
   12.19  action() {
   12.20 +	local w cols scol msg chars padding
   12.21 +	w=$(_ 'w'); w=${w/w/10}
   12.22 +	cols=$(get_cols); cols=${cols:-80}; scol=$(( $cols - $w ))
   12.23 +	msg="$(_n "$@" | fold -sw$scol)"
   12.24 +	chars=$(echo -n "$msg" | tail -n1 | wc -m); padding=$(( $scol - $chars ))
   12.25 +	msg="$(printf '%s%'$padding's' "$msg" "")"
   12.26 +
   12.27  	case $output in
   12.28 -		raw|gtk|html) _n "$@";;
   12.29 -		*) echo -ne "\033[0;33m$(_ "$@")\033[0m";;
   12.30 +		raw|gtk|html) echo -n "$msg";;
   12.31 +		*) echo -ne "\033[0;33m$msg\033[0m";;
   12.32  	esac
   12.33  }
   12.34