[pacman-dev] [PATCH 3/3] pacsearch now has localized output

Allan McRae allan at archlinux.org
Wed Jan 15 03:50:14 EST 2014


On 10/01/14 06:21, Pierre Neidhardt wrote:
> Signed-off-by: Pierre Neidhardt <ambrevar at gmail.com>
> ---
>  contrib/pacsearch.in | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in
> index d860471..10a6148 100644
> --- a/contrib/pacsearch.in
> +++ b/contrib/pacsearch.in
> @@ -77,13 +77,16 @@ if ($ARGV[0] eq "--nocolor" || $ARGV[0] eq "-n") {
>  	$RESET = "";
>  }
>  
> -my @COLORS=($RED, $GREEN, $YELLOW, $BLUE, $MAGENTA, $CYAN);
> +my @COLORS = ($RED, $GREEN, $YELLOW, $BLUE, $MAGENTA, $CYAN);

See comment in previous patch.

>  # We can choose if we output repo/pkgname bold or not. Same thing for 'ver group
>  # installed'. Not sure if it's worth a CLI option.
>  my $FMT_REPO = $BOLD;
>  my $FMT_OTHER = $REGULAR;
>  
> +# localization
> +my $LC_INSTALLED = `gettext pacman installed`;
> +
>  # Color a "repo/pkgname pkgver (goups) [installed]" line.
>  # We try to stick to pacman colors.
>  sub to_color {
> @@ -146,8 +149,7 @@ foreach $_ (@querypkgs) {
>  	if (not exists $allpkgs{$pkgfields[1]}) {
>  		# since 'group' is optional, we should fill it in if necessary
>  		$pkgfields[3] = "" if not defined $pkgfields[3];
> -		# TODO: localize the "installed" word
> -		$pkgfields[4] = "[installed]";
> +		$pkgfields[4] = "[" . $LC_INSTALLED . "]";
>  		# add a last field that indicates original order (after sync)
>  		push (@pkgfields, $cnt++);
>  		# add our local-only package to the hash
> 

Rest is fine.

A


More information about the pacman-dev mailing list