From f1fe4acc79657c2752d39498670b672f4ef56948 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 16 Jan 2009 02:18:15 +0000 Subject: Bug 460376: Make module-install instructions localizable. Patch By Max Kanat-Alexander (module owner) a=mkanat --- Bugzilla/Install/Requirements.pm | 100 +++++++++------------------------------ 1 file changed, 22 insertions(+), 78 deletions(-) (limited to 'Bugzilla/Install/Requirements.pm') diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 4d3296c09..bb6189d7a 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -25,6 +25,7 @@ package Bugzilla::Install::Requirements; use strict; +use Bugzilla::Constants; use Bugzilla::Install::Util qw(vers_cmp install_string); use List::Util qw(max); use Safe; @@ -40,7 +41,9 @@ our @EXPORT = qw( install_command ); -use Bugzilla::Constants; +# This is how many *'s are in the top of each "box" message printed +# by checksetup.pl. +use constant TABLE_WIDTH => 71; # The below two constants are subroutines so that they can implement # a hook. Other than that they are actually constants. @@ -366,61 +369,30 @@ sub print_module_instructions { { if (ON_WINDOWS) { - - print "\n* NOTE: You must run any commands listed below as " - . ROOT_USER . ".\n\n"; + print "\n", install_string('run_as_root', { root => ROOT_USER }), + "\n\n"; my $perl_ver = sprintf('%vd', $^V); # URL when running Perl 5.8.x. my $url_to_theory58S = 'http://theoryx5.uwinnipeg.ca/ppms'; - my $repo_up_cmd = -'* *'; # Packages for Perl 5.10 are not compatible with Perl 5.8. if (vers_cmp($perl_ver, '5.10') > -1) { $url_to_theory58S = 'http://cpan.uwinnipeg.ca/PPMPackages/10xx/'; } - # ActivePerl older than revision 819 require an additional command. + print install_string('ppm_repo_add', + { theory_url => $url_to_theory58S }); + # ActivePerls older than revision 819 require an additional command. if (_get_activestate_build_id() < 819) { - $repo_up_cmd = <{missing}}) { - print <{one_dbd}) { - print <{dbd}); printf "%10s: \%s\n", $db_modules{$db}->{name}, $command; - print ' ' x 12 . "Minimum version required: " - . $db_modules{$db}->{dbd}->{version} . "\n"; + print ' ' x 12, install_string('min_version_required'), + $db_modules{$db}->{dbd}->{version}, "\n"; } print "\n"; } @@ -457,42 +416,27 @@ EOT return unless $output; if (my @missing = @{$check_results->{optional}}) { - print <{package}), @missing)); # The first column header is at least 11 characters long. $longest_name = 11 if $longest_name < 11; - # The table is 71 characters long. There are seven mandatory + # The table is TABLE_WIDTH characters long. There are seven mandatory # characters (* and space) in the string. So, we have a total - # of 64 characters to work with. - my $remaining_space = 64 - $longest_name; - print '*' x 71 . "\n"; + # of TABLE_WIDTH - 7 characters to work with. + my $remaining_space = (TABLE_WIDTH - 7) - $longest_name; printf "* \%${longest_name}s * %-${remaining_space}s *\n", 'MODULE NAME', 'ENABLES FEATURE(S)'; - print '*' x 71 . "\n"; + print '*' x TABLE_WIDTH . "\n"; foreach my $package (@missing) { printf "* \%${longest_name}s * %-${remaining_space}s *\n", $package->{package}, $package->{feature}; } - print '*' x 71 . "\n"; + print '*' x TABLE_WIDTH . "\n"; - print "COMMANDS TO INSTALL:\n\n"; + print install_string('commands_to_install') . "\n\n"; foreach my $module (@missing) { my $command = install_command($module); printf "%15s: $command\n", $module->{package}; -- cgit v1.2.3-24-g4f1b