aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Rpmdragora/pkg.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-11-06 15:24:42 +0100
committerAngelo Naselli <anaselli@linux.it>2014-11-06 15:24:42 +0100
commit5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164 (patch)
tree2cba371f0f52ad846ea80dcb499bee5bedb5afb4 /lib/AdminPanel/Rpmdragora/pkg.pm
parentd65faf2ab17bb58ff11abef7815e819dfca1c691 (diff)
downloadmanatools-5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164.tar
manatools-5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164.tar.gz
manatools-5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164.tar.bz2
manatools-5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164.tar.xz
manatools-5a6d7d8a0cb8cc91ba22393899be5bc5db4ae164.zip
Moved locales to AdminPanel::Shared::Locales
Diffstat (limited to 'lib/AdminPanel/Rpmdragora/pkg.pm')
-rw-r--r--lib/AdminPanel/Rpmdragora/pkg.pm172
1 files changed, 87 insertions, 85 deletions
diff --git a/lib/AdminPanel/Rpmdragora/pkg.pm b/lib/AdminPanel/Rpmdragora/pkg.pm
index 465fbc4e..793de8fb 100644
--- a/lib/AdminPanel/Rpmdragora/pkg.pm
+++ b/lib/AdminPanel/Rpmdragora/pkg.pm
@@ -31,6 +31,7 @@ use common;
use POSIX qw(_exit ceil);
use URPM;
use utf8;
+use AdminPanel::rpmdragora;
use AdminPanel::Rpmdragora::open_db;
use AdminPanel::Rpmdragora::gurpm;
use AdminPanel::Rpmdragora::formatting;
@@ -46,6 +47,7 @@ use urpm::select;
use urpm::main_loop;
use urpm::args qw();
+my $loc = AdminPanel::rpmdragora::locale();
use Exporter;
our @ISA = qw(Exporter);
@@ -112,7 +114,7 @@ sub extract_header {
if ($p->flag_installed && !$p->flag_upgrade) {
my @files = map { chomp_($_) } run_rpm("rpm -ql $name");
- add2hash($pkg, { files => [ @files ? @files : N("(none)") ],
+ add2hash($pkg, { files => [ @files ? @files : $loc->N("(none)") ],
description => rpm_description(scalar(run_rpm("rpm -q --qf '%{description}' $name"))),
changelog => format_changelog_string($o_installed_version, scalar(run_rpm("rpm -q --changelog $name"))) });
} else {
@@ -124,14 +126,14 @@ sub extract_header {
$local_source = "$dir/" . $p->filename if $dir;
print "local_source: $local_source\n";
if (-e $local_source) {
- $bar_id = statusbar_msg(N("Getting information from %s...", $dir), 0);
+ $bar_id = statusbar_msg($loc->N("Getting information from %s...", $dir), 0);
$urpm->{log}("getting information from rpms from $dir");
} else {
my $gurpm;
- $bar_id = statusbar_msg(N("Getting '%s' from XML meta-data...", $xml_info), 0);
+ $bar_id = statusbar_msg($loc->N("Getting '%s' from XML meta-data...", $xml_info), 0);
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
if (my $xml_info_file = eval { urpm::media::any_xml_info($urpm, $medium, $xml_info, undef, sub {
- $gurpm ||= AdminPanel::Rpmdragora::gurpm->new(N("Please wait"),
+ $gurpm ||= AdminPanel::Rpmdragora::gurpm->new($loc->N("Please wait"),
'', # FIXME: add a real string after cooker
transient => $::main_window);
download_callback($gurpm, @_)
@@ -145,9 +147,9 @@ sub extract_header {
put_in_hash($xml_info_pkgs{$name} ||= {}, $nodes{$name});
} else {
if ($xml_info eq 'info') {
- $urpm->{info}(N("No xml info for medium \"%s\", only partial result for package %s", $medium->{name}, $name));
+ $urpm->{info}($loc->N("No xml info for medium \"%s\", only partial result for package %s", $medium->{name}, $name));
} else {
- $urpm->{error}(N("No xml info for medium \"%s\", unable to return any result for package %s", $medium->{name}, $name));
+ $urpm->{error}($loc->N("No xml info for medium \"%s\", unable to return any result for package %s", $medium->{name}, $name));
}
}
}
@@ -159,7 +161,7 @@ sub extract_header {
goto header_non_available;
};
my @files = $p->files;
- @files = N("(none)") if !@files;
+ @files = $loc->N("(none)") if !@files;
add2hash($pkg, { description => rpm_description($p->description),
files => \@files,
url => $p->url,
@@ -172,7 +174,7 @@ sub extract_header {
});
} elsif ($xml_info eq 'files') {
my @files = map { chomp_(to_utf8($_)) } split("\n", $xml_info_pkgs{$name}{files});
- add2hash($pkg, { files => [ @files ? @files : N("(none)") ] });
+ add2hash($pkg, { files => [ @files ? @files : $loc->N("(none)") ] });
} elsif ($xml_info eq 'changelog') {
add2hash($pkg, {
changelog => format_changelog_changelogs($o_installed_version,
@@ -184,7 +186,7 @@ sub extract_header {
}
return;
header_non_available:
- add2hash($pkg, { summary => $p->summary || N("(Not available)"), description => undef });
+ add2hash($pkg, { summary => $p->summary || $loc->N("(Not available)"), description => undef });
}
}
@@ -192,7 +194,7 @@ sub find_installed_version {
my ($p) = @_;
my $version;
open_rpm_db()->traverse_tag_find('name', $p->name, sub { $version = $_[0]->EVR });
- $version || N("(none)");
+ $version || $loc->N("(none)");
}
my $canceled;
@@ -200,15 +202,15 @@ sub download_callback {
my ($gurpm, $mode, $file, $percent, $total, $eta, $speed) = @_;
$canceled = 0;
if ($mode eq 'start') {
- $gurpm->label(N("Downloading package `%s'...", basename($file)));
- $gurpm->validate_cancel(but(N("Cancel")), sub { $canceled = 1 });
+ $gurpm->label($loc->N("Downloading package `%s'...", basename($file)));
+ $gurpm->validate_cancel(but($loc->N("Cancel")), sub { $canceled = 1 });
} elsif ($mode eq 'progress') {
$gurpm->label(
join("\n",
- N("Downloading package `%s'...", basename($file)),
+ $loc->N("Downloading package `%s'...", basename($file)),
(defined $total && defined $eta ?
- N(" %s%% of %s completed, ETA = %s, speed = %s", $percent, $total, $eta, $speed)
- : N(" %s%% completed, speed = %s", $percent, $speed)
+ $loc->N(" %s%% of %s completed, ETA = %s, speed = %s", $percent, $total, $eta, $speed)
+ : $loc->N(" %s%% completed, speed = %s", $percent, $speed)
) =~ /^\s*(.*)/
),
);
@@ -247,12 +249,12 @@ sub warn_about_media {
if (@update_medias > 0) {
if (!$options{skip_updating_mu} && !$is_update_media_already_asked) {
$is_update_media_already_asked = 1;
- $::rpmdragora_options{'no-confirmation'} or interactive_msg(N("Confirmation"),
-N("I need to contact the mirror to get latest update packages.
+ $::rpmdragora_options{'no-confirmation'} or interactive_msg($loc->N("Confirmation"),
+$loc->N("I need to contact the mirror to get latest update packages.
Please check that your network is currently running.
Is it ok to continue?"), yesno => 1
-# TODO widget => gtknew('CheckButton', text => N("Do not ask me next time"),
+# TODO widget => gtknew('CheckButton', text => $loc->N("Do not ask me next time"),
# active_ref => \$::rpmdragora_options{'no-confirmation'}
# )
) or myexit(-1);
@@ -262,27 +264,27 @@ Is it ok to continue?"), yesno => 1
}
} else {
if (any { $_->{update} } @{$urpm->{media}}) {
- interactive_msg(N("Already existing update media"),
-N("You already have at least one update medium configured, but
+ interactive_msg($loc->N("Already existing update media"),
+$loc->N("You already have at least one update medium configured, but
all of them are currently disabled. You should run the Software
Media Manager to enable at least one (check it in the \"%s\"
column).
-Then, restart \"%s\".", N("Enabled"), $AdminPanel::rpmdragora::myname_update));
+Then, restart \"%s\".", $loc->N("Enabled"), $AdminPanel::rpmdragora::myname_update));
myexit(-1);
}
my ($mirror) = choose_mirror($urpm, transient => $w->{real_window} || $::main_window,
message => join("\n\n",
- N("You have no configured update media. MageiaUpdate cannot operate without any update media."),
- N("I need to contact the Mageia website to get the mirror list.
+ $loc->N("You have no configured update media. MageiaUpdate cannot operate without any update media."),
+ $loc->N("I need to contact the Mageia website to get the mirror list.
Please check that your network is currently running.
Is it ok to continue?"),
),
);
my $m = ref($mirror) ? $mirror->{url} : '';
- $m or interactive_msg(N("How to choose manually your mirror"),
-N("You may also choose your desired mirror manually: to do so,
+ $m or interactive_msg($loc->N("How to choose manually your mirror"),
+$loc->N("You may also choose your desired mirror manually: to do so,
launch the Software Media Manager, and then add a `Security
updates' medium.
@@ -437,7 +439,7 @@ sub get_pkgs {
my (%options) = @_;
my $w = $::main_window;
- my $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
+ my $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? $loc->N("Please wait") : $loc->N("Package installation..."), $loc->N("Initializing..."), transient => $::main_window);
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
#my $_flush_guard = Gtk2::GUI_Update_Guard->new;
@@ -452,24 +454,24 @@ sub get_pkgs {
# update media list in case warn_about_media() added some:
@update_medias = get_update_medias($urpm);
- $gurpm->label(N("Reading updates description"));
+ $gurpm->label($loc->N("Reading updates description"));
$gurpm->progress(100);
#- parse the description file
my $update_descr = urpm::get_updates_description($urpm, @update_medias);
- my $_unused = N("Please wait, finding available packages...");
+ my $_unused = $loc->N("Please wait, finding available packages...");
# find out installed packages:
init_progress_bar($urpm);
- $gurpm->label(N("Please wait, listing base packages..."));
+ $gurpm->label($loc->N("Please wait, listing base packages..."));
$gurpm->progress(ceil($level*100));
my $db = eval { open_rpm_db() };
if (my $err = $@) {
- interactive_msg(N("Error"), N("A fatal error occurred: %s.", $err));
+ interactive_msg($loc->N("Error"), $loc->N("A fatal error occurred: %s.", $err));
return;
}
@@ -477,7 +479,7 @@ sub get_pkgs {
local $SIG{INT} = $sig_handler;
local $SIG{QUIT} = $sig_handler;
- $gurpm->label(N("Please wait, finding installed packages..."));
+ $gurpm->label($loc->N("Please wait, finding installed packages..."));
$level = 0.33*100;
$gurpm->progress(ceil($level));
reset_pbar_count(0.66*100);
@@ -494,7 +496,7 @@ sub get_pkgs {
$urpm->{state} = {};
- $gurpm->label(N("Please wait, finding available packages..."));
+ $gurpm->label($loc->N("Please wait, finding available packages..."));
$level = 0.66*100;
$gurpm->progress(ceil($level));
@@ -597,9 +599,9 @@ sub display_READMEs_if_needed {
my %Readmes = %{$urpm->{readmes}};
if (keys %Readmes) { #- display the README*.urpmi files
interactive_packtable(
- N("Upgrade information"),
+ $loc->N("Upgrade information"),
$w,
- N("These packages come with upgrade information"),
+ $loc->N("These packages come with upgrade information"),
[ map {
my $fullname = $_;
[ gtkpack__(
@@ -607,17 +609,17 @@ sub display_READMEs_if_needed {
gtkset_selectable(gtknew('Label', text => $Readmes{$fullname}),1),
),
gtksignal_connect(
- gtknew('Button', text => N("Upgrade information about this package")),
+ gtknew('Button', text => $loc->N("Upgrade information about this package")),
clicked => sub {
interactive_msg(
- N("Upgrade information about package %s", $Readmes{$fullname}),
+ $loc->N("Upgrade information about package %s", $Readmes{$fullname}),
(join '' => map { s/$/\n/smg; $_ } formatAlaTeX(scalar cat_($fullname))),
scroll => 1,
);
},
),
] } keys %Readmes ],
- [ gtknew('Button', text => N("Ok"), clicked => sub { Gtk2->main_quit }) ]
+ [ gtknew('Button', text => $loc->N("Ok"), clicked => sub { Gtk2->main_quit }) ]
);
}
}
@@ -631,13 +633,13 @@ sub perform_parallel_install {
if ($res) {
$$statusbar_msg_id = statusbar_msg(
- #N("Everything installed successfully"),
- N("All requested packages were installed successfully."),
+ #$loc->N("Everything installed successfully"),
+ $loc->N("All requested packages were installed successfully."),
);
} else {
interactive_msg(
- N("Problem during installation"),
- N("There was a problem during the installation:\n\n%s", join("\n", @error_msgs)),
+ $loc->N("Problem during installation"),
+ $loc->N("There was a problem during the installation:\n\n%s", join("\n", @error_msgs)),
scroll => 1,
);
}
@@ -656,8 +658,8 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my $fatal_msg = $_[1];
printf STDERR "Fatal: %s\n", $fatal_msg;
undef $gurpm;
- interactive_msg(N("Installation failed"),
- N("There was a problem during the installation:\n\n%s", $fatal_msg));
+ interactive_msg($loc->N("Installation failed"),
+ $loc->N("There was a problem during the installation:\n\n%s", $fatal_msg));
goto return_with_exit_code;
};
local $urpm->{error} = sub { printf STDERR "Error: %s\n", $_[0]; push @error_msgs, $_[0] };
@@ -679,7 +681,7 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
}
my $state = $priority_state || $probe_only_for_updates ? { } : $urpm->{rpmdragora_state};
- my $bar_id = statusbar_msg(N("Checking validity of requested packages..."), 0);
+ my $bar_id = statusbar_msg($loc->N("Checking validity of requested packages..."), 0);
# FIXME: THIS SET flag_requested on all packages!!!!
# select packages to install / enssure selected pkg set is consistant:
@@ -698,9 +700,9 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my ($local_sources, $blist) = urpm::get_pkgs::selected2local_and_blists($urpm, $state->{selected});
if (!$local_sources && (!$blist || !@$blist)) {
interactive_msg(
- N("Unable to get source packages."),
- N("Unable to get source packages, sorry. %s",
- @error_msgs ? N("\n\nError(s) reported:\n%s", join("\n", @error_msgs)) : ''),
+ $loc->N("Unable to get source packages."),
+ $loc->N("Unable to get source packages, sorry. %s",
+ @error_msgs ? $loc->N("\n\nError(s) reported:\n%s", join("\n", @error_msgs)) : ''),
scroll => 1,
);
goto return_with_exit_code;
@@ -717,21 +719,21 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my ($size, $filesize) = $urpm->selected_size_filesize($state);
my $install_count = int(@pkgs);
my $to_install = $install_count == 0 ? '' :
- ($priority_state ? '<b>' . N("Rpmdragora or one of its priority dependencies needs to be updated first. Rpmdragora will then restart.") . '</b>' . "\n\n" : '') .
+ ($priority_state ? '<b>' . $loc->N("Rpmdragora or one of its priority dependencies needs to be updated first. Rpmdragora will then restart.") . '</b>' . "\n\n" : '') .
(P("The following package is going to be installed:", "The following %d packages are going to be installed:", $install_count, $install_count)
. "\n\n" . format_list(map { s!.*/!!; $_ } @pkgs));
my $remove_count = scalar(@to_remove);
- interactive_msg(($to_install ? N("Confirmation") : N("Some packages need to be removed")),
+ interactive_msg(($to_install ? $loc->N("Confirmation") : $loc->N("Some packages need to be removed")),
join("\n\n",
($r ?
(!$to_install ? (P("Remove one package?", "Remove %d packages?", $remove_count, $remove_count), $r) :
(($remove_count == 1 ?
- N("The following package has to be removed for others to be upgraded:")
- : N("The following packages have to be removed for others to be upgraded:")), $r), if_($to_install, $to_install))
+ $loc->N("The following package has to be removed for others to be upgraded:")
+ : $loc->N("The following packages have to be removed for others to be upgraded:")), $r), if_($to_install, $to_install))
: $to_install),
format_size($size),
format_filesize($filesize),
- N("Is it ok to continue?")),
+ $loc->N("Is it ok to continue?")),
scroll => 1,
yesno => 1) or return 1;
@@ -740,14 +742,14 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
# select packages to uninstall for !update mode:
perform_removal($urpm, { map { $_ => $pkgs->{$_} } @to_remove }) if !$probe_only_for_updates;
- # $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
+ # $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? $loc->N("Please wait") : $loc->N("Package installation..."), $loc->N("Initializing..."), transient => $::main_window);
# my $_gurpm_clean_guard = before_leaving { undef $gurpm };
my $something_installed;
if (@to_install && $::rpmdragora_options{auto_orphans}) {
urpm::orphans::compute_future_unrequested_orphans($urpm, $state);
if (my @orphans = map { scalar $_->fullname } @{$state->{orphans_to_remove}}) {
- interactive_msg(N("Orphan packages"), P("The following orphan package will be removed.",
+ interactive_msg($loc->N("Orphan packages"), P("The following orphan package will be removed.",
"The following orphan packages will be removed.", scalar(@orphans))
. "\n" . urpm::orphans::add_leading_spaces(join("\n", @orphans) . "\n"), scroll => 1);
}
@@ -763,13 +765,13 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my $pkg = defined $id ? $urpm->{depslist}[$id] : undef;
if ($subtype eq 'start') {
if ($type eq 'trans') {
- print(1 ? N("Preparing package installation...") : N("Preparing package installation transaction..."));
- # $gurpm->label(1 ? N("Preparing package installation...") : N("Preparing package installation transaction..."));
+ print(1 ? $loc->N("Preparing package installation...") : $loc->N("Preparing package installation transaction..."));
+ # $gurpm->label(1 ? $loc->N("Preparing package installation...") : $loc->N("Preparing package installation transaction..."));
} elsif (defined $pkg) {
$something_installed = 1;
- print(N("Installing package `%s' (%s/%s)...", $pkg->name, ++$transaction_progress_nb, scalar(@{$transaction->{upgrade}}))."\n" . N("Total: %s/%s", ++$progress_nb, $install_count));
- # $gurpm->label(N("Installing package `%s' (%s/%s)...", $pkg->name, ++$transaction_progress_nb, scalar(@{$transaction->{upgrade}}))
- # . "\n" . N("Total: %s/%s", ++$progress_nb, $install_count));
+ print($loc->N("Installing package `%s' (%s/%s)...", $pkg->name, ++$transaction_progress_nb, scalar(@{$transaction->{upgrade}}))."\n" . $loc->N("Total: %s/%s", ++$progress_nb, $install_count));
+ # $gurpm->label($loc->N("Installing package `%s' (%s/%s)...", $pkg->name, ++$transaction_progress_nb, scalar(@{$transaction->{upgrade}}))
+ # . "\n" . $loc->N("Total: %s/%s", ++$progress_nb, $install_count));
}
} elsif ($subtype eq 'progress') {
$gurpm->progress($total ? ceil(($amount/$total)*100) : 100);
@@ -833,19 +835,19 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
copy_removable => sub {
my ($medium) = @_;
interactive_msg(
- N("Change medium"),
- N("Please insert the medium named \"%s\"", $medium),
- yesno => 1, text => { no => N("Cancel"), yes => N("Ok") },
+ $loc->N("Change medium"),
+ $loc->N("Please insert the medium named \"%s\"", $medium),
+ yesno => 1, text => { no => $loc->N("Cancel"), yes => $loc->N("Ok") },
);
},
- pre_check_sig => sub { $gurpm->label(N("Verifying package signatures...")) },
+ pre_check_sig => sub { $gurpm->label($loc->N("Verifying package signatures...")) },
check_sig => sub { $gurpm->progress(ceil(++$progress/$total)*100) },
bad_signature => sub {
my ($msg, $msg2) = @_;
local $::main_window = $gurpm->{real_window};
$msg =~ s/:$/\n\n/m; # FIXME: to be fixed in urpmi after 2008.0
interactive_msg(
- N("Warning"), "$msg\n\n$msg2", yesno => 1, if_(10 < ($msg =~ tr/\n/\n/), scroll => 1),
+ $loc->N("Warning"), "$msg\n\n$msg2", yesno => 1, if_(10 < ($msg =~ tr/\n/\n/), scroll => 1),
);
},
post_download => sub {
@@ -855,30 +857,30 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
need_restart => sub {
my ($need_restart_formatted) = @_;
# FIXME: offer to restart the system
- interactive_msg(N("Warning"), join("\n", values %$need_restart_formatted), scroll => 1);
+ interactive_msg($loc->N("Warning"), join("\n", values %$need_restart_formatted), scroll => 1);
},
trans_error_summary => sub {
my ($nok, $errors) = @_;
interactive_msg(
- N("Problem during installation"),
- if_($nok, N("%d installation transactions failed", $nok) . "\n\n") .
- N("There was a problem during the installation:\n\n%s",
+ $loc->N("Problem during installation"),
+ if_($nok, $loc->N("%d installation transactions failed", $nok) . "\n\n") .
+ $loc->N("There was a problem during the installation:\n\n%s",
join("\n\n", @$errors, @error_msgs)),
scroll => 1,
);
},
need_restart => sub {
my ($need_restart_formatted) = @_;
- interactive_msg(N("Warning"),
+ interactive_msg($loc->N("Warning"),
join("\n\n", values %$need_restart_formatted));
},
success_summary => sub {
if (!($done || @to_remove)) {
- interactive_msg(N("Error"),
- N("Unrecoverable error: no package found for installation, sorry."));
+ interactive_msg($loc->N("Error"),
+ $loc->N("Unrecoverable error: no package found for installation, sorry."));
return;
}
- my $id = statusbar_msg(N("Inspecting configuration files..."), 0);
+ my $id = statusbar_msg($loc->N("Inspecting configuration files..."), 0);
my %pkg2rpmnew;
foreach my $id (@rpms_upgrade) {
my $pkg = $urpm->{depslist}[$id];
@@ -886,20 +888,20 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
$pkg2rpmnew{$pkg->fullname} = [ grep { -r "$_.rpmnew" || -r "$_.rpmsave" } $pkg->conf_files ];
}
statusbar_msg_remove($id);
- dialog_rpmnew(N("The installation is finished; everything was installed correctly.
+ dialog_rpmnew($loc->N("The installation is finished; everything was installed correctly.
Some configuration files were created as `.rpmnew' or `.rpmsave',
you may now inspect some in order to take actions:"),
%pkg2rpmnew)
- and statusbar_msg(N("All requested packages were installed successfully."), 1);
- statusbar_msg(N("Looking for \"README\" files..."), 1);
+ and statusbar_msg($loc->N("All requested packages were installed successfully."), 1);
+ statusbar_msg($loc->N("Looking for \"README\" files..."), 1);
display_READMEs_if_needed($urpm, $w);
},
already_installed_or_not_installable => sub {
my ($msg1, $msg2) = @_;
my $msg = join("\n", @$msg1, @$msg2);
return if !$msg; # workaround missing state
- interactive_msg(N("Error"), $msg);
+ interactive_msg($loc->N("Error"), $msg);
},
},
);
@@ -925,16 +927,16 @@ you may now inspect some in order to take actions:"),
exit(0);
}
- my $_s1 = N("RPM transaction %d/%d", 0, 0);
- my $_s2 = N("Unselect all");
- my $_s3 = N("Details");
+ my $_s1 = $loc->N("RPM transaction %d/%d", 0, 0);
+ my $_s2 = $loc->N("Unselect all");
+ my $_s3 = $loc->N("Details");
statusbar_msg_remove($statusbar_msg_id); #- XXX maybe remove this
if ($exit_code == 0 && !$::rpmdragora_options{auto_orphans}) {
if (urpm::orphans::check_unrequested_orphans_after_auto_select($urpm)) {
if (my $msg = urpm::orphans::get_now_orphans_gui_msg($urpm)) {
- interactive_msg(N("Orphan packages"), $msg, scroll => 1);
+ interactive_msg($loc->N("Orphan packages"), $msg, scroll => 1);
}
}
}
@@ -950,7 +952,7 @@ sub perform_removal {
my ($urpm, $pkgs) = @_;
my @toremove = map { if_($pkgs->{$_}{selected}, $pkgs->{$_}{urpm_name}) } keys %$pkgs;
return if !@toremove;
- my $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? N("Please wait") : N("Please wait, removing packages..."), N("Initializing..."), transient => $::main_window);
+ my $gurpm = AdminPanel::Rpmdragora::gurpm->new(1 ? $loc->N("Please wait") : $loc->N("Please wait, removing packages..."), $loc->N("Initializing..."), transient => $::main_window);
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
my $may_be_orphans = 1;
@@ -970,7 +972,7 @@ sub perform_removal {
my @results;
slow_func_statusbar(
- N("Please wait, removing packages..."),
+ $loc->N("Please wait, removing packages..."),
$::main_window,
sub {
@results = $::rpmdragora_options{parallel}
@@ -983,15 +985,15 @@ sub perform_removal {
);
if (@results) {
interactive_msg(
- N("Problem during removal"),
- N("There was a problem during the removal of packages:\n\n%s", join("\n", @results)),
+ $loc->N("Problem during removal"),
+ $loc->N("There was a problem during the removal of packages:\n\n%s", join("\n", @results)),
if_(@results > 1, scroll => 1),
);
return 1;
} else {
if ($may_be_orphans && !$::rpmdragora_options{auto_orphans}) {
if (my $msg = urpm::orphans::get_now_orphans_gui_msg($urpm)) {
- interactive_msg(N("Information"), $msg, scroll => 1);
+ interactive_msg($loc->N("Information"), $msg, scroll => 1);
}
}
return 0;