sub do_search {
my ($params, $opts, $html_header, $menu, $page_content) = @_;
sub do_search {
my ($params, $opts, $html_header, $menu, $page_content) = @_;
my $suites_param = join ',', @{$params->{values}{suite}{no_replace}};
my $sections_param = join ',', @{$params->{values}{section}{no_replace}};
my $archs_param = join ',', @{$params->{values}{arch}{no_replace}};
my $suites_param = join ',', @{$params->{values}{suite}{no_replace}};
my $sections_param = join ',', @{$params->{values}{section}{no_replace}};
my $archs_param = join ',', @{$params->{values}{arch}{no_replace}};
- hint( "Can't find that package. ".
- "<a href=\"$SEARCH_URL/$keyword_esc\">".
- ($#non_results+1)."</a>".
+ hint( _g( "Can't find that package." )." ".
+ sprintf( _g( '<a href="%s">%s</a>'.
- error( "Can't find that string, at least not in that suite ($suites_enc, section $sections_enc) and on that architecture ($archs_enc)." );
+ error( sprintf( _g( "Can't find that string, at least not in that suite (%s, section %s) and on that architecture (%s)." ),
+ $suites_enc, $sections_enc, $archs_enc ) );
- $printed++;
- hint( "You have searched only for words exactly matching your keywords. You can try to search <a href=\"$SEARCH_CGI?exact=0;searchon=$searchon;suite=$suites_param;section=$sections_param;keywords=$keyword_esc;arch=$archs_param\">allowing subword matching</a>." );
+ hint( sprintf( _g( 'You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching</a>.' ),
+ encode_entities("$SEARCH_URL?exact=0&$opts->{common_params}") ) );
- %$html_header = ( title => 'Package Search Results' ,
- lang => 'en',
- title_tag => 'Debian Package Search Results',
+ %$html_header = ( title => _g( 'Package Search Results' ) ,
+ lang => $opts->{lang},
+ title_tag => _g( 'Debian Package Search Results' ),
#my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts );
my $str = '<div id="psearchres">';
#my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts );
my $str = '<div id="psearchres">';
$str .= &$print_func( $keyword, $pkgs->{$keyword}||{},
map { $_->{$keyword}||{} } @func_args );
@$pkgs_list = grep { $_ ne $keyword } @$pkgs_list;
}
if (@$pkgs_list && (($opts->{searchon} ne 'names') || !$opts->{exact})) {
$str .= &$print_func( $keyword, $pkgs->{$keyword}||{},
map { $_->{$keyword}||{} } @func_args );
@$pkgs_list = grep { $_ ne $keyword } @$pkgs_list;
}
if (@$pkgs_list && (($opts->{searchon} ne 'names') || !$opts->{exact})) {
- $str .= "<p><a href=\"$SEARCH_URL/FIXME\">".
- ($#{$pkgs_list}+1)."</a> results have not been displayed because you requested only exact matches.</p>";
+ $str .= "<p>".sprintf( _g( '<a href="%s">%s</a> results have not been displayed because you requested only exact matches.' ),
+ encode_entities("$SEARCH_URL?exact=0&$opts->{common_params}"),
+ scalar @$pkgs_list )."</p>";
sub print_package {
my ($pkg, $pkgs, $provided_by, $archives, $sect, $subsect, $desc) = @_;
sub print_package {
my ($pkg, $pkgs, $provided_by, $archives, $sect, $subsect, $desc) = @_;
foreach my $suite (@SUITES) {
foreach my $archive (@ARCHIVES) {
next if $archive eq 'security';
foreach my $suite (@SUITES) {
foreach my $archive (@ARCHIVES) {
next if $archive eq 'security';
join( ', ', map { "<a href=\"$ROOT/$path/$_\">$_</a>" } @$p);
}
$str .= "</li>\n";
} elsif (my $p = $provided_by->{$suite}{$archive}) {
$str .= sprintf( "<li><a href=\"$ROOT/%s/%s\">%s</a>: Virtual package<br>",
$path, $pkg, $path );
join( ', ', map { "<a href=\"$ROOT/$path/$_\">$_</a>" } @$p);
}
$str .= "</li>\n";
} elsif (my $p = $provided_by->{$suite}{$archive}) {
$str .= sprintf( "<li><a href=\"$ROOT/%s/%s\">%s</a>: Virtual package<br>",
$path, $pkg, $path );
sub print_src_package {
my ($pkg, $pkgs, $archives, $sect, $subsect, $binaries) = @_;
sub print_src_package {
my ($pkg, $pkgs, $archives, $sect, $subsect, $binaries) = @_;
$suite.(($archive ne 'us')?"/$archive":''), $pkg, $suite.(($archive ne 'us')?"/$archive":''), $subsect->{$suite}{$archive}{source},
$pkgs->{$suite}{$archive}, $origin_str );
$suite.(($archive ne 'us')?"/$archive":''), $pkg, $suite.(($archive ne 'us')?"/$archive":''), $subsect->{$suite}{$archive}{source},
$pkgs->{$suite}{$archive}, $origin_str );
my @bp_links;
foreach my $bp (@{$binaries->{$suite}{$archive}}) {
my $bp_link = sprintf( "<a href=\"$ROOT/%s/%s\">%s</a>",
my @bp_links;
foreach my $bp (@{$binaries->{$suite}{$archive}}) {
my $bp_link = sprintf( "<a href=\"$ROOT/%s/%s\">%s</a>",