]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoSearch.pm
Change _small.db layout a bit, to include virtual packages consisely at the
[deb/packages.git] / lib / Packages / DoSearch.pm
index 776b288fd9745169e84582b15fa3a2db85c1ec6d..275cb9bebc73d4a3846f4645b6b1779be1af0e3e 100644 (file)
@@ -86,19 +86,24 @@ sub do_search {
     my $std = timediff($st1, $st0);
     debug( "Search took ".timestr($std) ) if DEBUG;
     
-    my $suite_wording = $suites_enc eq "all" ? "all suites"
-       : "suite(s) <em>$suites_enc</em>";
-    my $section_wording = $sections_enc eq 'all' ? "all sections"
-       : "section(s) <em>$sections_enc</em>";
-    my $arch_wording = $archs_enc eq 'any' ? "all architectures"
-       : "architecture(s) <em>$archs_enc</em>";
+    my $suite_wording = $suites_enc eq "all" ? _g("all suites")
+       : sprintf(_g("suite(s) <em>%s</em>", $suites_enc) );
+    my $section_wording = $sections_enc eq 'all' ? _g("all sections")
+       : sprintf(_g("section(s) <em>%s</em>", $sections_enc) );
+    my $arch_wording = $archs_enc eq 'any' ? _g("all architectures")
+       : sprintf(_g("architecture(s) <em>%s</em>", $archs_enc) );
     if ($searchon eq "names") {
-       my $source_wording = $opts->{source} ? "source " : "";
-       my $exact_wording = $opts->{exact} ? "named" : "that names contain";
-       msg( "You have searched for ${source_wording}packages $exact_wording <em>$keyword_enc</em> in $suite_wording, $section_wording, and $arch_wording." );
+       my $source_wording = $opts->{source} ? _g("source packages") : _g("packages");
+       # sorry to all translators for that one... (patches welcome)
+       msg( sprintf( _g( "You have searched for %s that names contain <em>%s</em> in %s, %s, and %s." ),
+                     $source_wording, $keyword_enc,
+                     $suite_wording, $section_wording, $arch_wording ) );
     } else {
-       my $exact_wording = $opts->{exact} ? "" : " (including subword matching)";
-       msg( "You have searched for <em>$keyword_enc</em> in packages names and descriptions in $suite_wording, $section_wording, and $arch_wording$exact_wording." );
+       my $exact_wording = $opts->{exact} ? "" : _g(" (including subword matching)");
+       msg( sprintf( _g( "You have searched for <em>%s</em> in packages names and descriptions in %s, %s, and %s%s." ),
+                     $keyword_enc,
+                     $suite_wording, $section_wording, $arch_wording,
+                     $exact_wording ) );
     }
 
     if ($Packages::Search::too_many_hits) {
@@ -178,7 +183,7 @@ sub do_search {
                    
                    $desc{$pkg}{$suite}{$archive}{$version} = $desc;
                } else {
-                   $provided_by{$pkg}{$suite}{$archive} = [ split /\s+/, $desc ];
+                   $provided_by{$pkg}{$suite} = [ split /\s+/, $desc ];
                }
            }
 
@@ -292,12 +297,12 @@ sub print_package {
                        if @archs_to_print;
                    $archs_printed{$_}++ foreach @archs_to_print;
                }
-               if (my $p =  $provided_by->{$suite}{$archive}) {
+               if (my $p =  $provided_by->{$suite}) {
                    $str .= '<br>'._g( 'also provided by: ' ).
                        join( ', ', map { "<a href=\"$ROOT/$path/$_\">$_</a>"  } @$p);
                }
                $str .= "</li>\n";
-           } elsif (my $p =  $provided_by->{$suite}{$archive}) {
+           } elsif (my $p =  $provided_by->{$suite}) {
                $str .= sprintf( "<li><a href=\"$ROOT/%s/%s\">%s</a>: Virtual package<br>",
                                 $path, $pkg, $path );
                $str .= _g( 'provided by: ' ).