From 761ae5de8e84ffd70489260364db5789ec135b55 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 14 Sep 2006 13:57:29 +0000 Subject: Bug 352608: Make checksetup more localizable Patch By Max Kanat-Alexander (module owner) a=myk --- Bugzilla/Install.pm | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'Bugzilla/Install.pm') diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index c50abea95..18f7473ae 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -32,6 +32,7 @@ use Bugzilla::Group; use Bugzilla::Product; use Bugzilla::User; use Bugzilla::User::Setting; +use Bugzilla::Util qw(get_text); use Bugzilla::Version; use constant SETTINGS => { @@ -210,7 +211,8 @@ sub create_default_product { # Make the default Classification if it doesn't already exist. if (!$dbh->selectrow_array('SELECT 1 FROM classifications')) { my $class = DEFAULT_CLASSIFICATION; - print "Creating default classification '$class->{name}'...\n"; + print get_text('install_default_classification', + { name => $class->{name} }) . "\n"; $dbh->do('INSERT INTO classifications (name, description) VALUES (?, ?)', undef, $class->{name}, $class->{description}); @@ -219,7 +221,8 @@ sub create_default_product { # And same for the default product/component. if (!$dbh->selectrow_array('SELECT 1 FROM products')) { my $default_prod = DEFAULT_PRODUCT; - print "Creating initial dummy product '$default_prod->{name}'...\n"; + print get_text('install_default_product', + { name => $default_prod->{name} }) . "\n"; $dbh->do(q{INSERT INTO products (name, description) VALUES (?,?)}, @@ -367,19 +370,6 @@ sub _create_admin_exit { exit 1; } -sub get_text { - my ($name, $vars) = @_; - my $template = Bugzilla->template; - $vars ||= {}; - $vars->{'message'} = $name; - my $message; - $template->process('global/message.txt.tmpl', $vars, \$message) - || ThrowTemplateError($template->error()); - # Remove the indenting that exists in messages.html.tmpl. - $message =~ s/^ //gm; - return $message; -} - 1; __END__ -- cgit v1.2.3-24-g4f1b