]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoFilelist.pm
Fix some smaller issues reported by Thijs Kinkhorst
[deb/packages.git] / lib / Packages / DoFilelist.pm
index 562517784787fdae3b1a2a3dd62925dd1848b02c..a1dda56b95d01904096438c2b448ed828b39a37c 100644 (file)
@@ -7,12 +7,13 @@ use POSIX;
 use URI::Escape;
 use HTML::Entities;
 use DB_File;
-use Benchmark;
+use Benchmark ':hireswallclock';
 use Exporter;
 
 use Deb::Versions;
 use Packages::Config qw( $DBDIR $ROOT @SUITES @ARCHIVES @SECTIONS
                         @ARCHITECTURES %FTP_SITES );
+use Packages::I18N::Locale;
 use Packages::CGI;
 use Packages::DB;
 use Packages::Search qw( :all );
@@ -27,13 +28,13 @@ sub do_filelist {
     my ($params, $opts, $html_header, $menu, $page_content) = @_;
 
     if ($params->{errors}{package}) {
-       fatal_error( "package not valid or not specified" );
+       fatal_error( _g( "package not valid or not specified" ) );
     }
     if ($params->{errors}{suite}) {
-       fatal_error( "suite not valid or not specified" );
+       fatal_error( _g( "suite not valid or not specified" ) );
     }
     if ($params->{errors}{arch}) {
-       fatal_error( "arch not valid or not specified" );
+       fatal_error( _g( "architecture not valid or not specified" ) );
     }
 
     $$menu = '';
@@ -41,9 +42,9 @@ sub do_filelist {
     my $suite = $opts->{suite}[0];
     my $arch = $opts->{arch}[0] ||'';
 
-    %$html_header = ( title => "Filelist of package <em>$pkg</em> in <em>$suite</em> of arch <em>$arch</em>",
-                     title_tag => "Filelist of of package $pkg/$suite/$arch",
-                     lang => 'en',
+    %$html_header = ( title => sprintf( _g( "Filelist of package <em>%s</em> in <em>%s</em> of architecture <em>%s</em>" ), $pkg, $suite, $arch ),
+                     title_tag => sprintf( _g( "Filelist of package %s/%s/%s" ), $pkg, $suite, $arch ),
+                     lang => $opts->{lang},
                      keywords => "debian, $suite, $arch, filelist",
                      print_title => 1,
                      );
@@ -53,19 +54,19 @@ sub do_filelist {
            O_RDONLY, 0666, $DB_BTREE) {
 
            unless (exists $contents{$pkg}) {
-               fatal_error( "No such package in this suite on this arch" );
+               fatal_error( _g( "No such package in this suite on this architecture." ) );
            } else {
                my @files = unpack "L/(CC/a)", $contents{$pkg};
                my $file = "";
-               $$page_content .= '<pre style="border-top:solid #BFC3DC thin;padding:.5em;">';
+               $$page_content .= '<div id="pfilelist"><pre>';
                for (my $i=0; $i<scalar @files;) {
                    $file = substr($file, 0, $files[$i++]).$files[$i++];
-                   $$page_content .= "$file\n";
+                   $$page_content .= "/$file\n";
                }
-               $$page_content .= "</pre>";
+               $$page_content .= '</pre></div>';
            }
        } else {
-           fatal_error( "Invalid suite/arch combination" );
+           fatal_error( _g( "Invalid suite/architecture combination" ) );
        }
     }
 }