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

Pierre Neidhardt ambrevar at gmail.com
Thu Jan 9 15:21:46 EST 2014


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);
 
 # 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
-- 
1.8.5.2


More information about the pacman-dev mailing list