diff options
Diffstat (limited to 'drakwizard.pl')
-rwxr-xr-x | drakwizard.pl | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drakwizard.pl b/drakwizard.pl index 7639ece4..7d7914c4 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -82,7 +82,7 @@ else { $in->exit; -sub translate { +sub _ { my ($format, @params) = @_; !$format and return; @@ -133,7 +133,7 @@ sub get_parameter { }, Info => sub { # This is to avoid monospaced text to be interpolated - $leaf->{helpText} = translate($leaf->{helpText}); + $leaf->{helpText} = _($leaf->{helpText}); if ($leaf->{fontName} eq "Monospaced") { chomp($leaf->{helpText}); $leaf->{helpText} = $leaf->{helpText} ? "$leaf->{helpText}\n$leaf->{helpText}" : "$leaf->{helpText}\n"; @@ -188,13 +188,13 @@ sub display { } if ($page->{nextFinish} eq 'true') { $::Wizard_no_previous = 1; - $in->ask_okcancel(translate($page->{name}), - translate($page->{info})) or quit_global($in, 0); + $in->ask_okcancel(_($page->{name}), + _($page->{info})) or quit_global($in, 0); die; } elsif (!$page->{freetext}) { - $in->ask_okcancel(translate($page->{name}), - translate($page->{info})) or navigation($o, $page->{old_page}); + $in->ask_okcancel(_($page->{name}), + _($page->{info})) or navigation($o, $page->{old_page}); } else { my $valeur; @@ -221,10 +221,10 @@ sub display { } chomp($ENV{$variable{$_->{variableName}}}); $ENV{$_->{variableName}} = $ENV{$variable{$_->{variableName}}}; - ($_->{main_order} eq 'entry') ? { label => translate($_->{helpText}), + ($_->{main_order} eq 'entry') ? { label => _($_->{helpText}), val => \$ENV{$variable{$_->{variableName}}}, type => $_->{main_order} } : ($_->{main_order} eq 'bool') ? { val => \$ENV{$variable{$_->{variableName}}}, type => $_->{main_order}, - text => translate($_->{helpText}, advanced => 1) } + text => _($_->{helpText}, advanced => 1) } : ($_->{main_order} eq 'field') ? { val => $description{$ENV{$variable{$_->{variableName}}}}? $description{$ENV{$variable{$_->{variableName}}}} : @@ -234,12 +234,12 @@ sub display { list => [@liste], type => $_->{main_order} }; } @{$page->{freetext}}; if($page->{executionLevel} eq 'NORMAL') { - $in->ask_from(translate($page->{name}), translate($page->{info}), + $in->ask_from(_($page->{name}), _($page->{info}), \@data) or navigation($o, $page->{old_page}); foreach(@{$page->{freetext}}) { if($_->{main_order} eq 'bool') { $ENV{$variable{$_->{variableName}}} = $ENV{$variable{$_->{variableName}}} ? 1 : 0; - $description{$ENV{$variable{$_->{variableName}}}} = $ENV{$variable{$_->{variableName}}} ? __("enabled") : __("disabled"); + $description{$ENV{$variable{$_->{variableName}}}} = $ENV{$variable{$_->{variableName}}} ? _("enabled") : _("disabled"); } elsif ($_->{main_order} eq 'combo') { $ENV{$variable{$_->{variableName}}} = $chooser_hash{$ENV{$variable{$_->{variableName}}}}; |