1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

pacsearch: localized output

Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Pierre Neidhardt 2014-01-23 00:07:05 +01:00 committed by Allan McRae
parent 6fb2035dd0
commit 135d862eb6

View File

@ -65,6 +65,9 @@ my $CLR7 = "\e[1;36m";
my $INST = "\e[1;31m"; my $INST = "\e[1;31m";
my $BASE = "\e[0m"; my $BASE = "\e[0m";
# localization
my $LC_INSTALLED = `gettext pacman installed`;
# color a "repo/pkgname pkgver" line based on the repository name # color a "repo/pkgname pkgver" line based on the repository name
sub to_color { sub to_color {
my $line = shift; my $line = shift;
@ -128,7 +131,7 @@ foreach $_ (@querypkgs) {
$pkgfields[2] = "" if not defined $pkgfields[2]; $pkgfields[2] = "" if not defined $pkgfields[2];
# check if the package was listed in the sync out # check if the package was listed in the sync out
if (not exists $allpkgs{$pkgfields[1]}) { if (not exists $allpkgs{$pkgfields[1]}) {
$pkgfields[2] = "[installed]"; $pkgfields[2] = "[$LC_INSTALLED]";
# add a fifth field that indicates original order (after sync) # add a fifth field that indicates original order (after sync)
push (@pkgfields, $cnt++); push (@pkgfields, $cnt++);
# add our local-only package to the hash # add our local-only package to the hash