tazpanel rev 347

pkgs: display localized short description if it exists
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Feb 07 01:54:59 2013 +0000 (2013-02-07)
parents 4a0422a30ff6
children 972b3169b3e4
files pkgs.cgi
line diff
     1.1 --- a/pkgs.cgi	Sat Feb 02 14:49:17 2013 +0100
     1.2 +++ b/pkgs.cgi	Thu Feb 07 01:54:59 2013 +0000
     1.3 @@ -22,6 +22,14 @@
     1.4  	echo "$SCRIPT_NAME?info=$1" | sed 's/+/%2B/g'
     1.5  }
     1.6  
     1.7 +i18n_desc() {
     1.8 +	# Display localized short description
     1.9 +	if [ -e "$LOCALSTATE/packages-desc.$LANG" ]; then
    1.10 +		LOCDESC=$(grep -e "^$pkg	" $LOCALSTATE/packages-desc.$LANG | cut -d'	' -f2)
    1.11 +	[ "x$LOCDESC" != "x" ] && SHORT_DESC="$LOCDESC"
    1.12 +	fi
    1.13 +}
    1.14 +
    1.15  # We need packages information for list and search
    1.16  parse_packages_desc() {
    1.17  	IFS="|"
    1.18 @@ -29,6 +37,7 @@
    1.19  	do
    1.20  		image=tazpkg-installed.png
    1.21  		[ -d $INSTALLED/${PACKAGE% } ] || image=tazpkg.png
    1.22 +		i18n_desc
    1.23  		cat << EOT
    1.24  <tr>
    1.25  <td><input type="checkbox" name="pkg" value="$PACKAGE">
    1.26 @@ -247,6 +256,7 @@
    1.27  			colorpkg=$pkg
    1.28  			grep -qs "^$pkg$" $LOCALSTATE/blocked-packages.list &&
    1.29  				colorpkg="<span style='color: red;'>$pkg</span>"
    1.30 +			i18n_desc
    1.31  			cat << EOT
    1.32  <td class="pkg">
    1.33  	<input type="checkbox" name="pkg" value="$pkg" />
    1.34 @@ -302,6 +312,7 @@
    1.35  		do
    1.36  			[ -s $pkg/receipt ] && continue
    1.37  			. $target/$INSTALLED/$pkg/receipt
    1.38 +			i18n_desc
    1.39  			cat << EOT
    1.40  <tr>
    1.41  	<td class="pkg">
    1.42 @@ -650,6 +661,7 @@
    1.43  			<a class="button" href='$SCRIPT_NAME?do=Repack&$pkg'>$(gettext 'Repack')</a>
    1.44  EOT
    1.45  		fi
    1.46 +		i18n_desc
    1.47  		cat << EOT
    1.48  		</p>
    1.49  	</div>