]> git.deb.at Git - deb/packages.git/commitdiff
Merge commit 'alioth/master'
authorFrank Lichtenheld <frank@lichtenheld.de>
Sun, 14 Oct 2007 01:20:10 +0000 (03:20 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sun, 14 Oct 2007 01:20:10 +0000 (03:20 +0200)
26 files changed:
bin/create_index_pages
bin/parse-debtags-voc
bin/ttxgettext [new file with mode: 0755]
conf/apache.conf.sed.in
cron.d/500update_mo
lib/Packages/Dispatcher.pm
lib/Packages/DoIndex.pm
lib/Packages/DoShow.pm
lib/Packages/I18N/Locale.pm
lib/Packages/Template.pm
templates/config.tmpl
templates/config/architectures.tmpl
templates/config/mirrors.tmpl
templates/html/download.tmpl
templates/html/filelist.tmpl
templates/html/foot.tmpl
templates/html/head.tmpl
templates/html/index.tmpl
templates/html/newpkg.tmpl
templates/html/search.tmpl
templates/html/search_contents.tmpl
templates/html/show.tmpl
templates/html/suite_index.tmpl
templates/html/tag_index.tmpl
templates/rss/newpkg.tmpl
templates/txt/index.tmpl

index 8586671bdbbffb52616d7d331ab4d6255ebb02f1..0eaf63e8fbd475555c8a6f74593b5731fab17fdf 100755 (executable)
@@ -28,6 +28,7 @@ delete $ENV{'LC_ALL'};
 delete $ENV{'LC_MESSAGES'};
 bindtextdomain ( 'pdo', $LOCALES );
 bindtextdomain ( 'sections', $LOCALES );
+bindtextdomain ( 'templates', $LOCALES );
 textdomain( 'pdo' );
 
 my $wwwdir = "$TOPDIR/www";
@@ -49,16 +50,10 @@ my $priorities = retrieve "$DBDIR/priorities.info";
 #use Data::Dumper;
 #print STDERR Dumper($sections, $subsections, $priorities);
 
-my (%pages, %tt_vars);
+my (%pages);
 
-$tt_vars{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
-$tt_vars{make_url} = sub { return &Packages::CGI::make_url(@_) };
-# needed to work around the limitations of the the FILTER syntax
-$tt_vars{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
-$tt_vars{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
-$tt_vars{quotemeta} = sub { return quotemeta($_[0]) };
-
-my $template = new Packages::Template( "$TOPDIR/templates", 'html', \%tt_vars );
+my $template = new Packages::Template( "$TOPDIR/templates", 'html');
+my $txt_template = new Packages::Template( "$TOPDIR/templates", 'txt');
 
 print "write suite index files ...\n";
 foreach my $s (@SUITES) {
@@ -67,7 +62,7 @@ foreach my $s (@SUITES) {
     mkpath ( "$wwwdir/source/$key" );
     foreach my $lang (@LANGUAGES) {
        my $locale = get_locale( $lang );
-       my $charset = get_locale( $lang );
+       my $charset = get_charset( $lang );
        setlocale ( LC_ALL, $locale ) or do {
            warn "couldn't set locale ($lang/$locale)\n";
            next;
@@ -88,20 +83,14 @@ foreach my $s (@SUITES) {
            }
        }
 
-       open $pages{$key}{$lang}{index}{fh}, '>', "$wwwdir/$key/index.$lang.html.new"
-           or die "can't open index file for output: $!";
-       print {$pages{$key}{$lang}{index}{fh}} $template->page( 'suite_index', \%content );
-       close $pages{$key}{$lang}{index}{fh} or
-           warn "can't close index file $wwwdir/$key/index.$lang.html.new: $!";
+       $template->page( 'suite_index', \%content,
+                        "$wwwdir/$key/index.$lang.html.new");
        rename( "$wwwdir/$key/index.$lang.html.new",
                "$wwwdir/$key/index.$lang.html" );
 
        $content{source} = 'source';
-       open $pages{$key}{$lang}{source_index}{fh}, '>', "$wwwdir/source/$key/index.$lang.html.new"
-           or die "can't open index file for output: $!";
-       print {$pages{$key}{$lang}{source_index}{fh}} $template->page( 'suite_index', \%content );
-       close $pages{$key}{$lang}{source_index}{fh} or
-           warn "can't close index file $wwwdir/source/$key/index.$lang.html.new: $!";
+       $template->page( 'suite_index', \%content,
+                        "$wwwdir/source/$key/index.$lang.html.new");
        rename( "$wwwdir/source/$key/index.$lang.html.new",
                "$wwwdir/source/$key/index.$lang.html" );
 
@@ -204,64 +193,72 @@ sub write_files {
     foreach my $s (@SUITES) {
        my $key = $s;
        mkpath ( "$wwwdir/$source$key" );
-       print "writing $source$s/allpackages...\n";
-       $template->process( 'html/index.tmpl', { packages => $pkgs->{$key}, suite => $s, lang => 'en', is_source => $source  },
-                           "$wwwdir/$source$key/allpackages.en.html.new" )
-           or die "error writing allpackages for $key: ".$template->error();
-       print "writing $source$s/allpackages (txt)...\n";
-       my $gzfh = gzopen("$wwwdir/$source$key/allpackages.en.txt.gz.new",
-                     'wb9')
-           or die "can't open text index file for output: $!";
-       my $gztxt;
-       $template->process( 'txt/index.tmpl', { packages => $pkgs->{$key}, suite => $s, lang => 'en', is_source => $source  },
-                           \$gztxt )
-           or die "error writing allpackages txt for $key: ".$template->error();    
-       $gzfh->gzwrite($gztxt);
-       ($gzfh->gzclose == Z_OK) or
-           warn "can't close text index file $wwwdir/$source$key/allpackages.en.txt.gz.new: ".$gzfh->gzerror;
-
-       rename( "$wwwdir/$source$key/allpackages.en.html.new",
-               "$wwwdir/$source$key/allpackages.en.html" );
-       rename( "$wwwdir/$source$key/allpackages.en.txt.gz.new",
-               "$wwwdir/$source$key/allpackages.en.txt.gz" );
-       
-       foreach my $sec (keys %{$sections->{$s}}) {
-           mkpath ( "$wwwdir/$source$key/$sec" );
-
-           print "writing $source$s/$sec/index...\n";
-           $template->process( 'html/index.tmpl', { packages => [ grep { $_->{section} eq $sec } @{$pkgs->{$key}} ],
-                                                    suite => $s, lang => 'en', is_source => $source,
-                                                    category => { id => 'section', name => $sec } },
-                               "$wwwdir/$source$key/$sec/index.en.html.new" )
-               or die "error writing section index for $key/$sec: ".$template->error();
-           rename( "$wwwdir/$source$key/$sec/index.en.html.new",
-                   "$wwwdir/$source$key/$sec/index.en.html" );
-    }
-       foreach my $ssec ((keys %{$subsections->{$s}}, 'virtual')) {
-           next if $ssec eq '-';
-           mkpath ( "$wwwdir/$source$key/$ssec" );
-
-           print "writing $source$s/$ssec/index...\n";
-           $template->process( 'html/index.tmpl', { packages => [ grep { $_->{subsection} eq $ssec } @{$pkgs->{$key}} ],
-                                                    suite => $s, lang => 'en', is_source => $source,
-                                                    category => { id => 'subsection', name => $ssec } },
-                               "$wwwdir/$source$key/$ssec/index.en.html.new" )
-           or die "error writing subsection index for $key/$ssec: ".$template->error();
-       rename( "$wwwdir/$source$key/$ssec/index.en.html.new",
-               "$wwwdir/$source$key/$ssec/index.en.html" );
-       }
-       foreach my $prio (keys %{$priorities->{$s}}) {
-           next if $prio eq '-';
-           mkpath ( "$wwwdir/$source$key/$prio" );
-           
-           print "writing $source$s/$prio/index...\n";
-           $template->process( 'html/index.tmpl', { packages => [ grep { $_->{priority} eq $prio } @{$pkgs->{$key}} ],
-                                                    suite => $s, lang => 'en', is_source => $source,
-                                                    category => { id => 'priority', name => $prio } },
-                               "$wwwdir/$source$key/$prio/index.en.html.new" )
-               or die "error writing priority index for $key/$prio: ".$template->error();
-           rename( "$wwwdir/$source$key/$prio/index.en.html.new",
-                   "$wwwdir/$source$key/$prio/index.en.html" );
+       foreach my $lang (@LANGUAGES) {
+           my $locale = get_locale( $lang );
+           my $charset = get_charset( $lang );
+           setlocale ( LC_ALL, $locale ) or do {
+               warn "couldn't set locale ($lang/$locale)\n";
+               next;
+           };
+
+           my %lang_vars = ( lang => $lang, charset => $charset,
+                             used_langs => \@LANGUAGES );
+           print "writing $source$s/allpackages (lang=$lang)...\n";
+           $template->page( 'index', { %lang_vars, packages => $pkgs->{$key},
+                                       suite => $s, is_source => $source  },
+                            "$wwwdir/$source$key/allpackages.$lang.html.new" );
+           print "writing $source$s/allpackages (txt,lang=$lang)...\n";
+           my $gzfh = gzopen("$wwwdir/$source$key/allpackages.$lang.txt.gz.new",
+                             'wb9')
+               or die "can't open text index file for output: $!";
+           my $gztxt;
+           $gztxt = $txt_template->page( 'index', { %lang_vars, packages => $pkgs->{$key},
+                                                    suite => $s, is_source => $source  },
+                                         );
+           $gzfh->gzwrite($gztxt);
+           ($gzfh->gzclose == Z_OK) or
+               warn "can't close text index file $wwwdir/$source$key/allpackages.$lang.txt.gz.new: ".$gzfh->gzerror;
+
+           rename( "$wwwdir/$source$key/allpackages.$lang.html.new",
+                   "$wwwdir/$source$key/allpackages.$lang.html" );
+           rename( "$wwwdir/$source$key/allpackages.$lang.txt.gz.new",
+                   "$wwwdir/$source$key/allpackages.$lang.txt.gz" );
+
+           foreach my $sec (keys %{$sections->{$s}}) {
+               mkpath ( "$wwwdir/$source$key/$sec" );
+
+               print "writing $source$s/$sec/index (lang=$lang)...\n";
+               $template->page( 'index', { packages => [ grep { $_->{section} eq $sec } @{$pkgs->{$key}} ],
+                                           %lang_vars, suite => $s, is_source => $source,
+                                           category => { id => _g('Section'), name => $sec } },
+                                "$wwwdir/$source$key/$sec/index.$lang.html.new" );
+               rename( "$wwwdir/$source$key/$sec/index.$lang.html.new",
+                       "$wwwdir/$source$key/$sec/index.$lang.html" );
+           }
+           foreach my $ssec ((keys %{$subsections->{$s}}, 'virtual')) {
+               next if $ssec eq '-';
+               mkpath ( "$wwwdir/$source$key/$ssec" );
+
+               print "writing $source$s/$ssec/index (lang=$lang)...\n";
+               $template->page( 'index', { packages => [ grep { $_->{subsection} eq $ssec } @{$pkgs->{$key}} ],
+                                           %lang_vars, suite => $s, is_source => $source,
+                                           category => { id => _g('Subsection'), name => $ssec } },
+                                "$wwwdir/$source$key/$ssec/index.$lang.html.new" );
+               rename( "$wwwdir/$source$key/$ssec/index.$lang.html.new",
+                       "$wwwdir/$source$key/$ssec/index.$lang.html" );
+           }
+           foreach my $prio (keys %{$priorities->{$s}}) {
+               next if $prio eq '-';
+               mkpath ( "$wwwdir/$source$key/$prio" );
+
+               print "writing $source$s/$prio/index (lang=$lang)...\n";
+               $template->page( 'index', { packages => [ grep { $_->{priority} eq $prio } @{$pkgs->{$key}} ],
+                                           %lang_vars, suite => $s, is_source => $source,
+                                           category => { id => _g('Priority'), name => $prio } },
+                                "$wwwdir/$source$key/$prio/index.$lang.html.new" );
+               rename( "$wwwdir/$source$key/$prio/index.$lang.html.new",
+                       "$wwwdir/$source$key/$prio/index.$lang.html" );
+           }
        }
     }
 }
index 85649a6dddde38a494aafbd5431bc7e77cacfcf0..b6391564402db3bde8a04d621cfe8273ccff9f7c 100755 (executable)
@@ -111,12 +111,6 @@ foreach (@tags) {
 my %content = ( vocabulary => \%voc,
                facets => \@facets, tags => \@tags,
                tags_by_facet => \%tags_by_facet );
-# needed to work around the limitations of the the FILTER syntax
-$content{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
-$content{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
-$content{quotemeta} = sub { return quotemeta($_[0]) };
-$content{string2id} = sub { return &Packages::CGI::string2id(@_) };
-
 print TAGLST $template->page( 'tag_index', \%content );
 close TAGLST or warn "Couldn't close tag list: $!";
 
diff --git a/bin/ttxgettext b/bin/ttxgettext
new file mode 100755 (executable)
index 0000000..2afeafc
--- /dev/null
@@ -0,0 +1,110 @@
+#! /usr/bin/perl -w
+
+# copied from webwml/english/po/wmlxgettext.pl and
+# adapted for Template Toolkit
+#  Copyright © 2002-2003  Denis Barbier <barbier@debian.org>
+#  Copyright © 2007 Frank Lichtenheld <frank@lichtenheld.de>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+use strict;
+use Getopt::Std;
+
+use vars qw($opt_p);
+
+my $messages = {};
+my @msgids = ();
+
+my $domain = shift @ARGV;
+
+sub escape {
+        my $text = shift;
+        $text =~ s/\\/\\\\/g;
+        $text =~ s/"/\\"/g;
+        $text =~ s/\n/\\n/g;
+        $text =~ s/\t/\\t/g;
+        return $text;
+}
+
+sub countNewline {
+        my $text = shift;
+        return ($text =~ s/\n//g);
+}
+
+sub processFile {
+        my $file = shift;
+        my $prefix = shift;
+        my ($text, $lineno, $comment, $nextlineno, $msgid);
+        my (@messages) = ();
+        my (%msgids) = ();
+        my $repl = '';
+
+        open(IN, "< $file") || die "Unable to open $file\n";
+        local ($/) = undef;
+        $text = <IN>;
+        close(IN);
+
+        if ($prefix =~ s/=(.*)//) {
+                $repl = $1;
+        }
+        $file =~ s{^$prefix}{$repl}o unless $prefix eq '__';
+#        #  Remove comments if they contain <gettext> or </gettext>
+#        $text =~ s/^[ \t]*#.*<\/?gettext\b//mg;
+        $lineno = 1;
+        while ($text =~ m{\G(.*?) # begin at end of previous match, $1=prefix
+                             (\bg\(\s* # "g(" , $2=whole match
+                              (["']) # " quoting, $3=quotes
+                                (.*?)\3 # string, $4=string
+                              )}gxs) {
+                $msgid = escape($4);
+                $lineno += countNewline ($1.$2);
+                $nextlineno = countNewline ($4);;
+               my $dom = $domain;
+#                my $dom = ($3) ? $3 : 'templates';
+#                if ($domain ne $dom) {
+#                   $lineno += $nextlineno;
+#                   next;  # wrong domain
+#                }
+                $comment = '';
+                if ($1 =~ m/(((^|\n)[ \t]*#.*)+)\n?[^\n]*$/) {
+                        $comment = $1;
+                        $comment =~ s/^\s+#\s*//;
+                        $comment =~ s/\n[ \t]*#\s*/\n/g;
+                }
+                push (@msgids, $msgid);
+#                if (defined ($messages->{$msgid})) {
+#                        print STDERR "ttxgettext: Warning: msgid multiple defined:\n\t".
+#                                $msgid."\n";
+#                } else {
+#                        $messages->{$msgid} = [];
+#                }
+                push (@{$messages->{$msgid}}, $comment, $file, $lineno);
+                $lineno += $nextlineno;
+        }
+}
+
+$opt_p = '__';
+getopt('p');
+
+foreach (@ARGV) {
+        processFile($_, $opt_p);
+}
+
+print "msgid \"\"\nmsgstr \"\"\n".
+        "\"Content-Type: text/plain; charset=UTF-8\\n\"\n".
+        "\"Content-Transfer-Encoding: 8bit\\n\"\n\n";
+
+foreach my $msgid (@msgids) {
+        next unless $messages->{$msgid};
+        while (@{$messages->{$msgid}}) {
+                $_ = shift(@{$messages->{$msgid}});
+                s/\n/\n#. /g;
+                print "#. ".$_."\n" if $_;
+                print "#: ".shift(@{$messages->{$msgid}}).":".
+                            shift(@{$messages->{$msgid}})."\n";
+        }
+        print "msgid \"$msgid\"\nmsgstr \"\"\n\n";
+        undef $messages->{$msgid};
+}
index c71ef22956aedbf805635024cdc7dd6b9adbb541..5ed7453f90da1c1a23357877b9a6825017c15347 100644 (file)
   AddLanguage bg .bg
   AddLanguage ca .ca
   AddLanguage cs .cs
-  AddCharset ISO-8859-2 .cs
   AddLanguage da .da
-  AddCharset ISO-8859-1 .da
   AddLanguage de .de
   AddLanguage el .el
   AddLanguage eo .eo
   AddLanguage es .es
-  AddCharset ISO-8859-1 .es
   AddLanguage fi .fi
-  AddCharset ISO-8859-1 .fi
   AddLanguage fr .fr
   AddLanguage hr .hr
   AddLanguage hu .hu
-  AddCharset ISO-8859-2 .hu
   AddLanguage id .id
   AddLanguage it .it
-  AddCharset ISO-8859-1 .it
   AddLanguage ja .ja
-  AddCharset EUC_JP .ja
   AddLanguage ko .ko
   AddLanguage lt .lt
   AddLanguage nl .nl
-  AddCharset ISO-8859-1 .nl
   AddLanguage no .no
   AddLanguage nb .nb
   AddLanguage pl .pl
-  AddCharset ISO-8859-2 .pl
   AddLanguage pt .pt
-  AddCharset ISO-8859-1 .pt
   AddLanguage pt-pt .pt_PT
-  AddCharset ISO-8859-1 .pt_PT
   AddLanguage pt-br .pt_BR
-  AddCharset ISO-8859-1 .pt_BR
   AddLanguage ro .ro
   AddLanguage ru .ru
   AddLanguage sk .sk
-  AddCharset ISO-8859-2 .sk
   AddLanguage sl .sl
   AddLanguage sv .sv_SE
-  AddCharset ISO-8859-1 .sv_SE
   AddLanguage tr .tr
   AddLanguage uk .uk
-  AddCharset KOI8-U .uk
   AddLanguage zh-CN .zh-cn
   AddLanguage zh-HK .zh-hk
   AddLanguage zh-TW .zh-tw
index ec37c4fd0b0e699c6a661e109655deab72b6bb40..168a2fec669b63a3e1058ef7a8104373fbed4e9a 100755 (executable)
@@ -2,17 +2,21 @@
 
 . `dirname $0`/../config.sh
 
-gettextfiles=$(find cgi-bin lib -not -name 'LanguageNames.pm' -a -not -name 'Sections.pm' -a \( -name '*.pl' -o -name '*.pm' \));
+cd "$topdir"
+gettextfiles=$(find cgi-bin lib -not -name 'LanguageNames.pm' -a -not -name 'Sections.pm' -a \( -name '*.pl' -o -name '*.pm' \))
+templatefiles=$(find templates -name '*.tmpl' -o -name '*.inc')
 gettextfiles="$gettextfiles bin/create_index_pages"
-podomains="pdo sections langs"
+podomains="pdo templates sections langs"
 
 # Update pot
 #
 # Common options for all calls
-xgettext_opts="--language=Perl --keyword=_ --keyword=N_ --keyword=_g --foreign-user --add-comments"
+xgettext_opts="--language=Perl --keyword=N_ --keyword=_g --foreign-user --add-comments"
 
 echo gettextfiles=$gettextfiles
+echo templatefiles=$templatefiles
 xgettext $xgettext_opts -d pdo -o ${podir}/pdo.pot ${gettextfiles}
+$topdir/bin/ttxgettext templates ${templatefiles} >${podir}/templates.pot
 xgettext $xgettext_opts -d sections -o ${podir}/sections.pot ${libdir}/Packages/Sections.pm
 xgettext $xgettext_opts -d langs -o ${podir}/langs.pot ${libdir}/Packages/I18N/LanguageNames.pm
 
@@ -40,8 +44,8 @@ for lang in ${polangs}
 do
   for domain in ${podomains}
   do
-    mv ${domain}.${lang}.po ${domain}.${lang}.po.tmp
-    msgmerge -q -F -o ${domain}.${lang}.po ${domain}.${lang}.po.tmp ${domain}.pot
+    cp ${domain}.${lang}.po ${domain}.${lang}.po.tmp
+    msgmerge --previous --quiet --sort-by-file -o ${domain}.${lang}.po ${domain}.${lang}.po.tmp ${domain}.pot
     rm ${domain}.${lang}.po.tmp
     # normalize paths in .po files
     perl -p -i -e "s,^#:\s*\Q${topdir}\E,#: .,go" ${domain}.${lang}.po
index 221bfbec8234eccc5790b6579c18464e1a1f0bf9..e5c35d4bbb258813d4720dae716d1185e7c67a53 100755 (executable)
@@ -25,11 +25,9 @@ use warnings;
 use CGI;
 use POSIX;
 use File::Basename;
-use URI;
-use URI::Escape;
-use HTML::Entities;
 use Template;
 use DB_File;
+use URI::Escape;
 use Benchmark ':hireswallclock';
 use I18N::AcceptLanguage;
 use Locale::gettext;
@@ -102,8 +100,9 @@ sub do_dispatch {
                                   \@all_langs ) || 'en';
     debug( "LANGUAGES=@all_langs header=".
           ($input->http("Accept-Language")||'').
-          " http_lang=$http_lang", 2 ) if DEBUG;
+          " http_lang=$http_lang", 1 ) if DEBUG;
     bindtextdomain ( 'pdo', $LOCALES );
+    bindtextdomain ( 'templates', $LOCALES );
     textdomain( 'pdo' );
 
     # backwards compatibility stuff
@@ -287,7 +286,7 @@ sub do_dispatch {
                        setlocale( LC_ALL, "C" );
                    };
            };
-    debug( "locale=$locale charset=$charset", 2 ) if DEBUG;
+    debug( "locale=$locale charset=$charset", 1 ) if DEBUG;
 
     $opts{h_suites} = { map { $_ => 1 } @suites };
     $opts{h_sections} = { map { $_ => 1 } @sections };
@@ -331,19 +330,6 @@ sub do_dispatch {
     $page_content{opts} = \%opts;
     $page_content{params} = \%params;
 
-    $page_content{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
-    $page_content{make_url} = sub { return &Packages::CGI::make_url(@_) };
-    $page_content{extract_host} = sub { my $uri = URI->new($_[0]);
-                                       my $host = $uri->host;
-                                       $host .= ':'.$uri->port if $uri->port != $uri->default_port;
-                                       return $host;
-                                   };
-    # needed to work around the limitations of the the FILTER syntax
-    $page_content{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
-    $page_content{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
-    $page_content{quotemeta} = sub { return quotemeta($_[0]) };
-    $page_content{string2id} = sub { return &Packages::CGI::string2id(@_) };
-
     unless (@Packages::CGI::fatal_errors) {
        print $input->header(-charset => $charset, -type => get_mime($opts{format}) );
        #use Data::Dumper;
index 45a5b494bf8a7ba16da24b9a0a1b0093590190c9..1c8f52a5eacc6bd38de79eda4b8909bc125b6938 100644 (file)
@@ -44,14 +44,12 @@ sub send_file {
     $path .= "$opts->{archive}[0]/" if @{$opts->{archive}} == 1;
     $path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}};
     $path .= "$opts->{priority}[0]/" if @{$opts->{priority}};
-    # we don't have translated index pages for subsections yet
-    $opts->{lang} = 'en' if @{$opts->{subsection}} or $file eq 'allpackages';
 
     #FIXME: ugly hack
     if ($opts->{lang} ne 'en' and !-f "$wwwdir/$path$file.$opts->{lang}.$opts->{format}") {
-       $opts->{lang} = 'en';
+       $opts->{lang} = 'en';
     }
-    $path .= "$file.$opts->{lang}.$opts->{format}";    
+    $path .= "$file.$opts->{lang}.$opts->{format}";
 
     unless (@Packages::CGI::fatal_errors) {
        my $buffer;
index 51c97e72d0e562127ee14d575457cfcc6d028313..bf84444962d9e39ffe905b9a89fcea9aea1b7fee 100644 (file)
@@ -222,7 +222,7 @@ sub do_show {
                        my @downloads;
                        foreach my $a ( @archs ) {
                            my %d = ( arch => $a,
-                                     pkgsize => sprintf( '%.1f', floor(($sizes_deb->{$a}/102.4)+0.5)/10 ),
+                                     pkgsize => floor(($sizes_deb->{$a}/102.4)+0.5)/10,
                                      instsize => $sizes_inst->{$a}, );
 
                            $d{version} = $versions->{$a} if $multiple_versions;
@@ -311,7 +311,7 @@ sub do_show {
                        my $path = "/$source_dir/$src_file_name";
 
                        push @{$contents{srcfiles}}, { server => $server, path => $path, filename => $src_file_name,
-                                                      size => sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10)),
+                                                      size => floor(($src_file_size/102.4)+0.5)/10,
                                                       md5sum => $src_file_md5 };
                    }
 
index 623bfc7f9ce1f53e4eed09bfef5bf0183f28fa7a..fd987586020433cdf80680c4262f9950774d3f71 100644 (file)
@@ -49,6 +49,11 @@ sub get_charset {
     return $lang2charset{$lang} || $lang2charset{default};
 }
 
+sub tt_gettext {
+    my ($str, @args) = @_;
+    return dgettext( 'templates', $str ) unless @args;
+    return sprintf(dgettext( 'templates', $str ), @args);
+}
 sub _g { return gettext( $_[0] ) }
 sub N_ { return $_[0] }
 
index 554f2ce0e4c8551248ad625a9d0224190c1fff01..be71d154ffbcaf890d8e0fc8cec583e90a5ade81 100644 (file)
@@ -5,6 +5,9 @@ use warnings;
 
 use Template;
 use Locale::gettext;
+use URI ();
+use HTML::Entities ();
+use URI::Escape ();
 use Benchmark ':hireswallclock';
 
 use Packages::CGI;
@@ -19,6 +22,7 @@ use constant COMPILE => 1;
 
 sub new {
     my ($classname, $include, $format, $vars, $options) = @_;
+    $vars ||= {};
     $options ||= {};
 
     my $self = {};
@@ -29,6 +33,19 @@ sub new {
        year => $timestamp[5]+1900,
        string => scalar gmtime() .' UTC',
     };
+    $vars->{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
+    $vars->{make_url} = sub { return &Packages::CGI::make_url(@_) };
+    $vars->{g} = sub { return &Packages::I18N::Locale::tt_gettext(@_) };
+    $vars->{extract_host} = sub { my $uri = URI->new($_[0]);
+                                 my $host = $uri->host;
+                                 $host .= ':'.$uri->port if $uri->port != $uri->default_port;
+                                 return $host;
+                             };
+    # needed to work around the limitations of the the FILTER syntax
+    $vars->{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
+    $vars->{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
+    $vars->{quotemeta} = sub { return quotemeta($_[0]) };
+    $vars->{string2id} = sub { return &Packages::CGI::string2id(@_) };
 
     $self->{template} = Template->new( {
        PRE_PROCESS => [ 'config.tmpl' ],
@@ -53,7 +70,7 @@ sub error {
 }
 
 sub page {
-    my ($self, $action, $page_content) = @_;
+    my ($self, $action, $page_content, $target) = @_;
 
     #use Data::Dumper;
     #die Dumper($self, $action, $page_content);
@@ -63,9 +80,13 @@ sub page {
                                        @{$page_content->{used_langs}} );
 
     my $txt;
-    $self->process("$self->{format}/$action.tmpl", $page_content, \$txt)
-       or die sprintf( "template error: %s", $self->error ); # too late for reporting on-line
-
+    if ($target) {
+       $self->process("$self->{format}/$action.tmpl", $page_content, $target)
+           or die sprintf( "template error: %s", $self->error ); # too late for reporting on-line
+    } else {
+       $self->process("$self->{format}/$action.tmpl", $page_content, \$txt)
+           or die sprintf( "template error: %s", $self->error );
+    }
     return $txt;
 }
 
index 6fb12e0c8e214cb5f4cd88e8d969e806de646451..bb124e79c22fd52d49fe81145e549969aa114660 100644 (file)
    license = {
        url => homepage _ 'license'
    }
+   trademark = {
+       name => copyright.name,
+       url => homepage _ 'trademark'
+   }
    contact = {
-       name => 'Debian Web Mailinglist',
+       name => g('Debian Web Mailinglist'),
        mail => 'debian-www@lists.debian.org',
         url => homepage _ 'contact',
    }
    admin = {
-       name => 'Debian Webmaster',
+       name => g('%s Webmaster', organisation),
        mail => 'webmaster@debian.org',
    }
-   trademarknotes = organisation _ ' is a trademark of ' _ copyright.name
+   trademarknotes = g('%s is a <a href="%s">trademark</a> of %s', organisation, trademark.url, trademark.name)
 -%]
 [%-
    # possible values for importance: high, normal, low
    sitewidemsg = { importance => "high",
-                  txt => "Please note that this is an experimental version of <a href=\"http://packages.debian.org/\">packages.debian.org</a>. Errors and obsolete information should be expected" }
+                  txt => g('Please note that this is an experimental version of <a href="http://packages.debian.org/">packages.debian.org</a>. Errors and obsolete information should be expected') }
 -%]
index 1eda3bbb5c3c225391db1597e6f20799e2f8005e..41434a3404dfd1869bdfd696b49bd6c083d92730 100644 (file)
@@ -1,22 +1,22 @@
 [%
 # list of architectures
 architectures = {
-        i386    => 'Intel x86',
-        m68k    => 'Motorola 680x0',
-        sparc   => 'SPARC',
-        alpha   => 'Alpha',
-        powerpc => 'PowerPC',
-        arm     => 'ARM',
-        hppa    => 'HP PA-RISC',
-        ia64    => 'Intel IA-64',
-        mips    => 'MIPS (big-endian)',
-        mipsel  => 'MIPS (little-endian)',
-        s390    => 'IBM S/390',
-       "hurd-i386" => 'Hurd (i386)',
-       amd64   => 'AMD64',
-       armel   => 'EABI ARM',
-       "kfreebsd-i386" => 'GNU/kFreeBSD (i386)',
-       "kfreebsd-amd64" => 'GNU/kFreeBSD (amd64)'
+        i386    => g('Intel x86'),
+        m68k    => g('Motorola 680x0'),
+        sparc   => g('SPARC'),
+        alpha   => g('Alpha'),
+        powerpc => g('PowerPC'),
+        arm     => g('ARM'),
+        hppa    => g('HP PA-RISC'),
+        ia64    => g('Intel IA-64'),
+        mips    => g('MIPS (big-endian)'),
+        mipsel  => g('MIPS (little-endian)'),
+        s390    => g('IBM S/390'),
+       "hurd-i386" => g('Hurd (i386)'),
+       amd64   => g('AMD64'),
+       armel   => g('EABI ARM'),
+       "kfreebsd-i386" => g('GNU/kFreeBSD (i386)'),
+       "kfreebsd-amd64" => g('GNU/kFreeBSD (amd64)'),
 }
 
 %]
index a23ec99a7170da6dc8385c1d6343bfc3a34b8f84..0d77561a0692ee23571b4d666848c9da302c0e95 100644 (file)
@@ -179,12 +179,12 @@ mirrors = {
 ports_url = 'http://www.debian.org/ports/'
 
 continents = {
-               north_america => 'North America',
-               south_america => 'South America',
-               asia          => 'Asia',
-               australia     => 'Australia and New Zealand',
-               europa        => 'Europa',
-               africa        => 'Africa',
+               north_america => g('North America'),
+               south_america => g('South America'),
+               asia          => g('Asia'),
+               australia     => g('Australia and New Zealand'),
+               europa        => g('Europe'),
+               africa        => g('Africa'),
        }
 
 %]
index 4a405f24da53a63ee079e1d9a5b79120b4714891..4bd21e3ead17fe1419a256b09e476feebb677308 100644 (file)
@@ -1,11 +1,11 @@
 [%- PROCESS 'html/head.tmpl'
-   title_tag = "Package Download Selection -- $filename.file"
+   title_tag = g('Package Download Selection -- %s', $filename.file)
    description = desc
    keywords = "$suite, $archive, $section, $subsection, $version"
-   navigation = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/'), name=>suite },
-                 { prefix=>'Package:', url=>make_url(pkg,'','arch',undef), name=>pkg },
+   navigation = [ { prefix=>g('Distribution:'), title=>g('Overview over this suite'), url=>make_url('/'), name=>suite },
+                 { prefix=>g('Package:'), url=>make_url(pkg,'','arch',undef), name=>pkg },
                  { url=>make_url(pkg), name=>architecture },
-                 { name => 'Download' },
+                 { name => g('Download') },
                ]
 -%]
 [%- PROCESS 'config/archive_layout.tmpl' -%]
 [%- PROCESS 'html/messages.tmpl' -%]
 
 [% IF architecture != 'all' %]
-<h2>Download Page for <kbd>[% filename.file %]</kbd> on [% architectures.$architecture %] machines</h2>
+<h2>[% g('Download Page for <kbd>%s</kbd> on %s machines', filename.file, architectures.$architecture) %]</h2>
 [% ELSE %]
-<h2>Download Page for <kbd>[% filename.file %]</kbd></h2>
+<h2>[% g('Download Page for <kbd>%s</kbd>', filename.file) %]</h2>
 [% END %]
 
 <div class="pconstantnag">
-<p>If you are running Debian, it's strongly suggested to use a
-package manager like <a href="[% make_url('aptitude','','arch','') %]">aptitude</a> or
-<a href="[% make_url('synaptic','','arch','') %]">synaptic</a> to download and install
-packages, instead of doing so manually via this website.</p>
-<p>You should be able to use any of the listed mirrors by adding a
-line to your <kbd>/etc/apt/sources.list</kbd> like this:</p>
+<p>[% g('If you are running %s, it is strongly suggested to use a
+package manager like <a href="%s">aptitude</a> or
+<a href="%s">synaptic</a> to download and install
+packages, instead of doing so manually via this website.',
+       organisation, make_url('aptitude','','arch',''), make_url('synaptic','','arch','')) %]</p>
+<p>[% g('You should be able to use any of the listed mirrors by adding a
+line to your <kbd>/etc/apt/sources.list</kbd> like this:') %]</p>
 [% IF archive != "security" %]
 <pre>
 deb http://<em>[% mirrors.$archive.europa.0 %]</em> [% suite %] main [% section IF section != main_section %]
 </pre>
-<p>Replacing <em>[% mirrors.$archive.europa.0 %]</em> with the mirror in question.
+<p>[% g('Replacing <em>%s</em> with the mirror in question.', mirrors.$archive.europa.0) %]
 [% ELSE %]
 <pre>
 deb http://security.debian.org/debian-security [% suite _ "/updates" %] main [% section IF section != main_section %]
 </pre>
 [%- END %]
 [% IF suite == "experimental" %]
-<h2>Experimental package</h2>
-<p>Warning: This package is from the <strong>experimental</strong> distribution.
+<h2>[% g('Experimental package') %]</h2>
+<p>[% g('Warning: This package is from the <strong>experimental</strong> distribution.
 That means it is likely unstable or buggy, and it may even cause data loss.
 Please be sure to consult the changelog and other possible documentation before
-using it.</p>
+using it.') %]</p>
 [% END %]
 [% IF subsection == "debian-installer" %]
-<h2>debian-installer udeb package</h2>
-<p>Warning: This package is intended for the use in building
+<h2>[% g('debian-installer udeb package') %]</h2>
+<p>[% g('Warning: This package is intended for the use in building
 <a href="http://www.debian.org/devel/debian-installer">debian-installer</a> images only.
-Do not install it on a normal Debian system.</p>
+Do not install it on a normal %s system.', organisation) %]</p>
 [% END %]
 </div>
 
 [%- SET a = mirrors.$archive -%]
 
 [% IF archive != 'security' %]
-  <p>You can download the requested file from the <tt>[% filename.directory %]</tt> subdirectory at any of these sites:</p>
+  <p>[% g('You can download the requested file from the <tt>%s</tt> subdirectory at any of these sites:',
+       filename.directory) %]</p>
   <div class="cardleft">
   [% FOREACH continent IN [ 'north_america', 'south_america', 'asia', 'africa' ] %]
     [% IF a.$continent %]
@@ -79,16 +81,16 @@ Do not install it on a normal Debian system.</p>
   [% END %]
   </div>
 [% ELSE %]
-<p>You can download the requested file from the <tt>[% filename.directory %]</tt> subdirectory at:</p>
+<p>[% g('You can download the requested file from the <tt>%s</tt> subdirectory at:', filename.directory) %]</p>
 <ul><li><a href="http://security.debian.org/debian-security/[% filename.full %]">security.debian.org/debian-security</a></li></ul>
-<p>Debian security updates are currently officially distributed only via <tt>security.debian.org</tt></p>
+<p>[% g('Debian security updates are currently officially distributed only via <tt>security.debian.org</tt>.') %]</p>
 [% END %]
 
 <div id="pdownloadnotes">
 
 [% IF a.mirror_list %]
-<p style="clear:both">If none of the above sites are fast enough for you,
-please see our <a href="[% a.mirror_list %]">complete mirror list</a>.</p>
+<p style="clear:both">[% g('If none of the above sites are fast enough for you,
+please see our <a href="%s">complete mirror list</a>.', a.mirror_list ) %]</p>
 [% END %]
 
 [% IF a.unofficial_port %]
@@ -96,22 +98,23 @@ please see our <a href="[% a.mirror_list %]">complete mirror list</a>.</p>
 [% IF port.url_name;
    SET port.url = ports_url _ port.url_name _ '/';
    END -%]
-<p style="clear:both">Note that [% port.name %] is not officially included in the [% organisation %] archive yet,
-but the [% port.name %] porter group keeps their archive in sync with the official archive as close as possible.
-See the <a href="[% port.url %]">[% port.name %] ports page</a> for current information.</p>
+<p style="clear:both">[% g('Note that %s is not officially included in the %s archive yet,
+but the %s porter group keeps their archive in sync with the official archive as close as possible.
+See the <a href="%s">%s ports page</a> for current information.',
+       port.name, organisation, port.name, port.url, port.name) %]</p>
 [% END %]
 
-<p>Note that in some browsers you will need to tell your browser you want the file saved to a file.
-For example, in Firefox or Mozilla, you should hold the Shift key when you click on the URL.</p>
+<p>[% g('Note that in some browsers you will need to tell your browser you want the file saved to a file.
+For example, in Firefox or Mozilla, you should hold the Shift key when you click on the URL.') %]</p>
 
 </div>
 
-<h3>More information on <kbd>[% filename.file %]</kbd>:</h3>
+<h3>[% g('More information on <kbd>%s</kbd>:', filename.file) %]</h3>
 <table id="pdownloadmeta">
-<tr><th>Exact Size</th>                <td class="size">[% size %] Byte ([% pkgsize %] [% pkgsize_unit %])</td>
-<tr><th>MD5 checksum</th>              <td><tt>[% md5sum %]</tt></td>
-<tr><th>SHA1 checksum</th>             <td><tt>[% sha1 || 'Not Available' %]</tt></td>
-<tr><th>SHA256 checksum</th>           <td><tt>[% sha256  || 'Not Available' %]</tt></td>
+<tr><th>[% g('Exact Size') %]</th>     <td class="size">[% g('%s Byte (%s %s)', size, pkgsize, pkgsize_unit) %]</td>
+<tr><th>[% g('MD5 checksum') %]</th>   <td><tt>[% md5sum %]</tt></td>
+<tr><th>[% g('SHA1 checksum') %]</th>  <td><tt>[% sha1 || g('Not Available') %]</tt></td>
+<tr><th>[% g('SHA256 checksum') %]</th>        <td><tt>[% sha256  || g('Not Available') %]</tt></td>
 </table>
 
 [%- PROCESS 'html/foot.tmpl' -%]
index dbf9feaf06262a4e7cd53b7d0056df47ce3a14b2..e450d5fc20ffd8e7ad9584323940e81825ee8a39 100644 (file)
@@ -1,14 +1,13 @@
 [%- PROCESS 'html/head.tmpl'
-   title_tag = "Filelist of package $pkg/$suite/$arch"
-   page_title = "Filelist of package <em>$pkg</em> in <em>$suite</em> of architecture <em>$arch</em>"
+   title_tag = g("Filelist of package %s/%s/%s", pkg, suite, arch)
+   page_title = g("Filelist of package <em>%s</em> in <em>%s</em> of architecture <em>%s</em>", pkg, suite, arch)
    keywords = "$suite, $arch, filelist"
-   navigation = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/'), name=>suite },
-                 { prefix=>'Package:', url=>make_url(pkg,'','arch',undef), name=>pkg },
+   navigation = [ { prefix=>g('Distribution:'), title=>g('Overview over this suite'), url=>make_url('/'), name=>suite },
+                 { prefix=>g('Package:'), url=>make_url(pkg,'','arch',undef), name=>pkg },
                  { url=>make_url(pkg), name=>arch },
-                 { name => 'Filelist' },
+                 { name => g('Filelist') },
                ]
 -%]
-<h1></h1>
 
 [% FOREACH file IN files %]
 [%- '<div id="pfilelist"><pre>' IF loop.first -%]
index 17a5e2a2a22949c7ecde4cf3f27fa6adbc324b70..a08d34c866404010f76c5b1fd8e43069586c4313 100644 (file)
@@ -8,28 +8,31 @@ Total page evaluation took [% benchmark %]<br>
 [% IF langs.size > 0 %]
 <hr class="hidecss">
 <!--UdmComment-->
-<p>This page is also available in the following languages:</p>
+<p>[% g('This page is also available in the following languages:') %]</p>
 <p class="navpara">
 [% FOREACH l IN langs %]
 <a href="[% "$page_name?lang=$l.lang" %]" title="[% l.tooltip %]" hreflang="[% l.lang %]" lang="[% l.lang %]" rel="alternate">[% l.selfname %]
 [%- IF l.transliteration %] ([% l.transliteration %])[% END %]</a>
 [% END %]
 </p>
-<p>How to set <a href="[% cn_help_url %]">the default document language</a></p>
+<p>[% g('How to set <a href="%s">the default document language</a>', cn_help_url) %]</p>
 <!--/UdmComment-->
 [% END %]
 
 <hr class="hidecss">
-<p [%- ' class="bordertop"' IF langs.size > 0 %]>Back to: <a href="[% homepage %]">[% organisation %] homepage</a> || <a href="[% searchformurl %]">Packages search page</a></p>
+<p [%- ' class="bordertop"' IF langs.size > 0 %]>[% g('Back to:') %] <a href="[% homepage %]">[% g('%s Homepage', organisation) %]</a> || <a href="[% searchformurl %]">[% g('Packages search page') %]</a></p>
 
 <hr class="hidecss">
 <div id="fineprint" class="bordertop">
-<p>To report a problem with the web site, e-mail <a href="mailto:[% contact.mail %]">[% contact.mail %]</a>. For other contact information, see the [% organisation %] <a href="[% contact.url %]">contact page</a>.</p>
-<p>[% IF timestamp.string %]Generated: [% timestamp.string %]<br>[% END %]
-[% UNLESS footer.doNotDisplayCopyright %]
-Content Copyright &copy; [% copyright.years %] <a href="[% copyright.url %]">[% copyright.name %]</a>; See <a href="[% license.url %]">license terms</a>. [% IF trademarknotes -%][% trademarknotes %][%- END %]
-[% END %]
-<p><a href="/about/">Learn more about this site</a>.</p>
+<p>[% g('To report a problem with the web site, e-mail <a href="mailto:%s">%s</a>. For other contact information, see the %s <a href="%s">contact page</a>.',
+       contact.mail, contact.mail, organisation, contact.url) %]</p>
+<p>[% IF timestamp.string; g('Generated:') _ ' ' _ timestamp.string _ '<br>'; END %]
+[% UNLESS footer.doNotDisplayCopyright;
+       g('Content Copyright &copy; %s <a href="%s">%s</a>; See <a href="%s">license terms</a>.',
+               copyright.years, copyright.url, copyright.name, license.url);
+       ' ' _ trademarknotes IF trademarknotes;
+END %]
+<p><a href="/about/">[% g('Learn more about this site') %]</a>.</p>
 </div> <!-- end fineprint -->
 </div> <!-- end footer -->
 </div> <!-- end outer -->
index 05e8d975ece5281d1a3d3678c3bcb01c1381b295..bb8491ca47b7085f929ea1999c17dc16b8378e90 100644 (file)
 [% IF search_field_values.suite %]<input type="hidden" name="suite" value="[% search_field_values.suite %]">[% END %]
 [% IF search_field_values.sections %]<input type="hidden" name="section" value="[% search_field_values.sections %]">[% END %]
 [% IF search_field_values.architectures %]<input type="hidden" name="arch" value="[% search_field_values.architectures %]">[% END %]
-<input type="submit" value="Search">
+<input type="submit" value="[% g('Search') %]">
 <select size="1" name="searchon">
 <option value="names" [% selected IF search_field_values.searchon == 'names' || search_field_values.searchon == 'default' %]>
-package names</option>
-<option value="all" [% selected IF search_field_values.searchon == 'all' %]>descriptions</option>
-<option value="sourcenames" [% selected IF search_field_values.searchon == 'sourcenames' %]>source package names</option>
-<option value="contents" [% selected IF search_field_values.searchon == 'contents' %]>package contents</option>
+[% g('package names') %]</option>
+<option value="all" [% selected IF search_field_values.searchon == 'all' %]>[% g('descriptions') %]</option>
+<option value="sourcenames" [% selected IF search_field_values.searchon == 'sourcenames' %]>[% g('source package names') %]</option>
+<option value="contents" [% selected IF search_field_values.searchon == 'contents' %]>[% g('package contents') %]</option>
 </select>
 <input type="text" size="30" name="keywords" value="[% search_field_values.keywords | html %]" id="kw">
-<span style="font-size: 60%"><a href="[% searchformurl %]">all options</a></span>
+<span style="font-size: 60%"><a href="[% searchformurl %]">[% g('all options') %]</a></span>
 </div> <!-- end hpacketsearch -->
 </form>
 [% END %]
 
 </div> <!-- end upperheader -->
 
-<p class="hidecss"><a href="#inner">skip the navigation</a></p>
+<p class="hidecss"><a href="#inner">[% g('skip the navigation') %]</a></p>
 <div id="pnavbar">
- &gt;&gt; <a href="[% homepage %]" title="[% organisation %] Homepage">[% organisation %]</a>
- &gt;&gt; <a href="[% packages_homepage %]" title="[% organisation %] Packages Homepage">Packages</a>
+ &gt;&gt; <a href="[% homepage %]" title="[% g('%s Homepage', organisation) %]">[% organisation %]</a>
+ &gt;&gt; <a href="[% packages_homepage %]" title="[% g('%s Packages Homepage', organisation) %]">[% g('Packages') %]</a>
 [% FOREACH n IN navigation %]
  &gt;&gt; [% IF n.url %]<a href="[% n.url %]" [% IF n.title %]title="[% n.title %]"[% END %]>[% n.name %]</a>[% ELSE %][% n.name %][% END %] 
 [% END %]
index 74a30b0c27d39091533a188562245383936ce899..a5139b54c9b687f8eaaed51c4cc24fb139359a4d 100644 (file)
@@ -1,15 +1,19 @@
 [% PROCESS 'config/archive_layout.tmpl' %]
-[% pkg_type = is_source ? 'Source' : 'Software';
-   title_common = category ? "$pkg_type Packages in \"$suite\", $category.id $category.name"
-       : "$pkg_type Packages in \"$suite\"";
+[% IF is_source;
+       title_common = category ? g('Source Packages in "%s", %s %s', suite, category.id, category.name)
+                               : g('Source Packages in "%s"', suite);
+   ELSE;
+       title_common = category ? g('Software Packages in "%s", %s %s', suite, category.id, category.name)
+                               : g('Software Packages in "%s"', suite);
+   END;
 
-   nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','suite',suite), name=>suite } ];
+   nav_arr = [ { prefix=>g('Distribution:'), title=>g('Overview over this suite'), url=>make_url('/','','suite',suite), name=>suite } ];
    IF category;
        nav_last = { prefix=>"$category.id:", name=>category.name };
    ELSE;
-       nav_last = { name=>'All Packages' };
+       nav_last = { name=>g('All Packages') };
    END;
-   nav_arr.push( { name=>'Source',
+   nav_arr.push( { name=>g('Source'),
                   url=>make_url('/','','suite',suite,'source','source') } )
        IF is_source;
    nav_arr.push( nav_last );
@@ -31,7 +35,7 @@
   [% END %]
   [% IF providers.size %]
     <dt><a href="[% name %]" id="[% name %]">[% name %]</a></dt>
-       <dd>virtual package provided by
+       <dd>[% g('virtual package provided by') %]
        [% FOREACH provider IN providers %]<a href="../[% provider | uri %]">[% provider %]</a>
        [%- ', ' UNLESS loop.last %][% END %]</dd>
     [% IF versions.length %]
index 0f36b4cf807aa7b568f58113791801056ef4cc2e..aaff0745cf642f4237f585d932e6b7d5310c895b 100644 (file)
@@ -1,30 +1,37 @@
 [%- PROCESS 'html/head.tmpl'
-   title_tag = "New Packages in \"$suite\""
+   title_tag = g('New Packages in "%s"', suite)
    description = desc
    keywords = "$suite, new packages, $section"
    rss_alternate = 'newpkg?format=rss'
 -%]
-<h1>New Packages in "[% suite %]"</h1>
+<h1>[% g('New Packages in "%s"', suite) %]</h1>
 
-<p>The following packages were added to suite <em>[% suite %]</em>[% " (section $section)" IF section %] in the [% organisation %] archive during the last 7 days. You can also display this list
-[%- IF opts.mode == 'byage' %]
- <a href="[% make_url('newpkg','','mode','') %]">sorted by name</a>
-[%- ELSE %]
- <a href="[% make_url('newpkg','mode=byage') %]">sorted by age</a>
-[%- END %].</p>
-<p>This information is also available as an <a href="newpkg?format=rss">RSS feed</a>
-<a href="newpkg?format=rss"><img src="http://planet.debian.org/rss10.png" alt="[RSS 1.0 Feed]"></a></p>
+<p>
+[% IF section;
+       g('The following packages were added to suite <em>%s</em> (section %s) in the %s archive during the last 7 days.',
+       suite, section, organisation);
+   ELSE;
+       g('The following packages were added to suite <em>%s</em> in the %s archive during the last 7 days.',
+       suite, organisation);
+   END;
+   IF opts.mode == 'byage';
+       g(' You can also display this list <a href="%s">sorted by name</a>.', make_url('newpkg','','mode',''));
+   ELSE;
+       g(' You can also display this list <a href="%s">sorted by age</a>.', make_url('newpkg','mode=byage'));
+   END %]</p>
+<p>[% g('This information is also available as an <a href="newpkg?format=rss">RSS feed</a>') %]
+<a href="newpkg?format=rss"><img src="http://planet.debian.org/rss10.png" alt="[% g('[RSS 1.0 Feed]') %]"></a></p>
 
 [% FOREACH pkg IN new_packages %]
        [% '<ul>' IF loop.first %]
        <li><a href="[% pkg.0 %]">[% pkg.0 %]</a>
-       -- [% pkg.-1 | html %][% " <em>($pkg.1 days old)</em>" IF pkg.1 %]
+       -- [% pkg.-1 | html %][% g(' <em>(%u days old)</em>', pkg.1) IF pkg.1 %]
        [% '</ul>' IF loop.last %]
 [% END %]
 
-<p class="psmallcenter"><a href="[% make_url('allpackages','') %]" title="List of all packages">All packages</a><br>
-(<a href="[% make_url('allpackages','','format','txt.gz' ) %]">compact compressed textlist</a>)<br>
-  New packages in 
+<p class="psmallcenter"><a href="[% make_url('allpackages','') %]" title="[% g('List of all packages') %]">[% g('All packages') %]</a><br>
+(<a href="[% make_url('allpackages','','format','txt.gz' ) %]">[% g('compact compressed textlist') %]</a>)<br>
+  [% g('New packages in ') %] 
 [% FOREACH s IN sections %]
   [%- IF s == section -%]
 [% s %]
index 78b4786a2f8fc50bfee765a69ce3dd09f2c87dec..3427f2a9bd40ea7e347efeeb671361a3ade9ba63 100644 (file)
@@ -16,7 +16,7 @@
    architectures_enc = html_encode(architectures_str);
 -%]
 [%- PROCESS 'html/head.tmpl'
-   title_tag = "Package Search Results -- $keyword_enc"
+   title_tag = g("Package Search Results -- %s", keyword_enc)
    print_search_field = 'packages'
    search_field_values = {
        keywords => search_keywords.join(' '),
        architectures => params.values.arch.no_replace.join(','),
        sections => params.values.section.no_replace.join(','),
     }
-   navigation = [ { name => 'Package Search Results' } ]
+   navigation = [ { name => g('Package Search Results') } ]
 -%]
 
 <div id="psearchsug">
 [% UNLESS results %]
-       <p>You can try a different search on the <a href="[% searchformurl %]#search_packages">Packages search page</a>.</p>
+       <p>[% g('You can try a different search on the <a href="%s#search_packages">Packages search page</a>.',
+               searchformurl) %]</p>
        
        [% IF opts.searchon != "names" && opts.exact %]
-       <p>You have searched only for words exactly matching your keywords.
-       You can try to search <a href="[% make_search_url('',"keywords=$keyword_esc",'exact',0) %]">allowing subword matching</a>
+       <p>[% g('You have searched only for words exactly matching your keywords. You can try to search <a href="%s">allowing subword matching.',
+               make_search_url('',"keywords=$keyword_esc",'exact',0) ) %]</a>
        [% END %]
 [% END %]
 [% IF opts.searchon == "names" && non_results %]
-<p><a href="[% search_url %][% keyword_esc %]">[% non_results %]</a>
-results have not been displayed due to the search parameters.</p>
+<p>[% g('<a href="%s">%u</a> results have not been displayed due to the search parameters.',
+       "$search_url$keyword_esc", non_results) %]</p>
 [% END %]
 </div>
 
@@ -47,42 +48,45 @@ results have not been displayed due to the search parameters.</p>
 
 <div id="psearchres">
 
-[% suite_wording = suite_enc.match("^(default|all)$") ? "all suites" : "suite(s) <em>$suite_enc</em>";
-   section_wording = (section_enc == 'all') ? "all sections" : "section(s) <em>$section_enc</em>";
-   arch_wording = (architectures_enc == 'any') ? "all architectures" : "architecture(s) <em>$architectures_enc</em>";
+[%# @translators: I'm really sorry :/ %]
+[% suite_wording = suite_enc.match("^(default|all)$") ? g("all suites") : g("suite(s) <em>$suite_enc</em>");
+   section_wording = (section_enc == 'all') ? g("all sections") : g("section(s) <em>$section_enc</em>");
+   arch_wording = (architectures_enc == 'any') ? g("all architectures") : g("architecture(s) <em>$architectures_enc</em>");
     IF opts.searchon == "names";
-       source_wording = opts.source ? "source packages" : "packages";
-       msg = "You have searched for $source_wording that names contain <em>$keyword_enc</em> in $suite_wording, $section_wording, and $arch_wording .";
+       source_wording = opts.source ? g("source packages") : g("packages");
+       msg = 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;
-       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 .";
+       exact_wording = opts.exact ? "" : g(" (including subword matching)");
+       msg = 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);
     END %]
 <p>[% msg %]
 
 [% IF results %]
-Found <strong>[% results %]</strong> matching packages.</p>
+[% g('Found <strong>%u</strong> matching packages.', results) %]</p>
 [% END %]
 
 [% IF too_many_hits %]
 [% IF opts.searchon != "names" %]
-<p id="psearchtoomanyhits">Note that this only shows the best matches, sorted by relevance.
+<p id="psearchtoomanyhits">[% g("Note that this only shows the best matches, sorted by relevance.
 If the first few packages don't match what you searched for, try using more keywords or alternative
-keywords.</p>
+keywords.") %]</p>
 [% ELSE %]
-<p id="psearchtoomanyhits">Your search was too wide so we will only display exact matches.
-At least <em>[% too_many_hits %]</em> results have been omitted and will not be displayed.
-Please consider using a longer keyword or more keywords.</p>
+<p id="psearchtoomanyhits">[% g('Your search was too wide so we will only display exact matches.
+At least <em>%u</em> results have been omitted and will not be displayed.
+Please consider using a longer keyword or more keywords.', too_many_hits) %]</p>
 [% END; END %]
 
 [% UNLESS results %]
-<p id="psearchnoresult">Sorry, your search gave no results</p>
+<p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
 [% END %]
 
 [% FOREACH categories %]
   [% "<h2>$name</h2>" IF name %]
 
 [% FOREACH packages %]
-  <h3>Package [% pkg %]</h3>
+  <h3>[% g('Package %s', pkg) %]</h3>
   <ul>
   [% FOREACH s IN suites;
        suite = s.suite %]
@@ -92,7 +96,7 @@ Please consider using a longer keyword or more keywords.</p>
       <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
     [% END %]
     [% IF s.providers %]
-       <br>[% 'also ' IF s.versions.size > 0 %]provided by: [% FOREACH provider IN s.providers %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
+       <br>[% 'also ' IF s.versions.size > 0 %][% g('provided by:') %] [% FOREACH provider IN s.providers %]<a href="[% make_url(provider,'','suite',suite) %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]
     [% END %]
     </li>
   [% END %]
@@ -100,7 +104,7 @@ Please consider using a longer keyword or more keywords.</p>
 [% END %]
 
 [% FOREACH src_packages %]
-  <h3>Source Package [% pkg %]</h3>
+  <h3>[% g('Source Package %s', pkg) %]</h3>
   <ul>
   [% FOREACH origins %]
      [% origin = (archive == main_archive) ? suite : "$suite/$archive";
@@ -108,9 +112,9 @@ Please consider using a longer keyword or more keywords.</p>
     <li><a class="resultlink" href="[% make_url(pkg,'','source','source','suite',origin,'section','','arch','') %]">[% origin %]</a> ([% subsection %]): [% version %]
       [%- IF section %] [<strong class="pmarker">[% section %]</strong>][% END %]
       [%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
-    <br>Binary packages: <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">[% FOREACH binary IN binaries %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
+    <br>[% g('Binary packages:') %] <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">[% FOREACH binary IN binaries %]<a href="[% make_url(binary,'','source','','suite',suite,'archive',archive,'arch','','archive','') %]">[% binary %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
        [% IF binaries.size > 10 %]
-       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% binaries.size %] binary packages")</script>
+       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %])</script>
        [% END %]
     </li>
   [% END %]
@@ -120,7 +124,8 @@ Please consider using a longer keyword or more keywords.</p>
 [% END %]
 
 [% IF skipped %]
-  <p><a href="[% make_search_url('',"keywords=$keyword_esc",'exact', 0) %]">[% skipped %]</a> results have not been displayed because you requested only exact matches.
+  <p>[% g('<a href="%s">%u</a> results have not been displayed because you requested only exact matches.',
+       make_search_url('',"keywords=$keyword_esc",'exact', 0), skipped) %]
 [% END %]
 
 </div>
index 71a0019362946b713ef6c126635747c19fc9bcc6..513b4514df5cbf33bbf87cdfb128c8d751eda582 100644 (file)
    architectures_enc = html_encode(architectures_str);
 -%]
 [%- PROCESS 'html/head.tmpl'
-   title_tag = "Package Contents Search Results -- $keyword_enc"
+   title_tag = g("Package Contents Search Results -- %s", keyword_enc)
    keywords = "$suite"
    print_search_field = 'packages'
-   navigation = [ { title => '', name => 'Package Contents Search Results', url => '' } ]
+   navigation = [ { title => '', name => g('Package Contents Search Results'), url => '' } ]
    search_field_values = {
        keywords => search_keywords.join(' '),
        searchon => 'contents',
 
 <ul class="linklist">
 [% IF mode != 'filename' %]
-<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','filename') %]">Search for <em>[% keyword_enc %]</em> within filenames</a>
+<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','filename') %]">
+[%- g('Search for <em>%s</em> within filenames', keyword_enc) %]</a>
 [% END %]
 
 [% IF mode != 'exactfilename' %]
-<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','exactfilename') %]">Search exact filename <em>[% keyword_enc %]</em></a>
+<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','exactfilename') %]">
+[%- g('Search exact filename <em>%s</em>', keyword_enc) %]</a>
 [% END %]
 
 [% IF mode == 'exactfilename' || mode == 'filename' %]
-<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','') %]">Search for paths ending with <em>[% keyword_enc %]</em></a>
+<li><a href="[% make_search_url('',"keywords=$keyword_esc",'mode','') %]">
+[%- g('Search for paths ending with <em>%s</em>', keyword_enc) %]</a>
 [% END %]
 </ul>
 
-<p>Search in other suite:
+<p>[% g('Search in other suite:') %]
 [% FOREACH s IN all_suites %]
        [% IF s != suite %]
        [<a href="[% make_search_url('',"keywords=$keyword_esc",'suite',s) %]">[% s  %]</a>]
 [% END %]
 
 [% UNLESS search_architectures.size == 1 || all_architectures.size == 1 %]
-<p>Limit search to a specific architecture:
+<p>[% g('Limit search to a specific architecture:') %]
 [% FOREACH a IN all_architectures %] [<a href="[% make_search_url('',"keywords=$keyword_esc",'arch',a) %]">[% a %]</a>][% END %]
 [% END %]
 
 [% IF search_architectures.size == 1 %]
-<p>Search in <a href="[% make_search_url('',"keywords=$keyword_esc",'arch','any') %]">all architectures</a>
+<p>[% g('Search in <a href="%s">all architectures</a>',
+       make_search_url('',"keywords=$keyword_esc",'arch','any')) %]
 [% END %]
 
 </div>
 [%- PROCESS 'html/messages.tmpl' -%]
 <div id="pcontentsres">
 
-[% suite_wording = "suite <em>$suite</em>";
-   section_wording = ( section_enc == 'all' ? "all sections" : "section(s) <em>$section_enc</em>" );
-   arch_wording = ( architectures_enc == 'any' ? "all architectures" : "architecture(s) <em>$architectures_enc</em>" );
-   wording = "paths that end with";
+[%# @translators: I'm really sorry :/ %]
+[% section_wording = ( section_enc == 'all' ? g("all sections") : g("section(s) <em>%s</em>", section_enc) );
+   arch_wording = ( architectures_enc == 'any' ? g("all architectures") : g("architecture(s) <em>%s</em>", architectures_enc) );
+   wording = g("paths that end with");
    IF mode == 'filename';
-       wording =  "files named";
+       wording = g("files named");
    ELSIF mode == 'exactfilename';
-       wording = "filenames that contain";
+       wording = g("filenames that contain");
    END %]
-<p>You have searched for [% wording %] <em>[% keyword_enc %]</em> in [% suite_wording %], [% section_wording %], and [% arch_wording %].
+<p>[% g('You have searched for %s <em>%s</em> in suite <em>%s</em>, %s, and %s.',
+       wording, keyword_enc, suite, section_wording, arch_wording) %]
 
 [% IF results.size %]
-Found <strong>[% results.size %] results</strong>.
+[% g('Found <strong>%u results</strong>.', results.size) %]
 
 [% IF too_many_hits %]
-<p id="psearchtoomanyhits">Note: Your search was too wide so we will only display only the first about 100 matches.
-Please consider using a longer keyword or more keywords.</p>
+<p id="psearchtoomanyhits">[% g('Note: Your search was too wide so we will only display only the first about 100 matches.
+Please consider using a longer keyword or more keywords.') %]</p>
 [% END %]
 
 <table>
@@ -90,8 +95,10 @@ Please consider using a longer keyword or more keywords.</p>
        <col>
        </colgroup>
 <tr>
-       <th><a title="Sort results by filename" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=file") %]">File</a></th>
-       <th><a title="Sort results by package name" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=pkg") %]">Packages</a></th>
+       <th><a title="[% g('Sort results by filename') %]" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=file") %]">
+               [%- g('File') %]</a></th>
+       <th><a title="[% g('Sort results by package name') %]" href="[% make_search_url('',"keywords=$keyword_esc&amp;sort_by=pkg") %]">
+               [%- g('Packages') %]</a></th>
 </tr>
 [% FOREACH results %]
 [% file = html_encode(file);
@@ -105,7 +112,7 @@ Please consider using a longer keyword or more keywords.</p>
         <td>
         [% FOREACH packages %]
        [% arch_str = architectures.join(', ');
-          SET arch_str = "not $arch_str" IF ( arch_str && architectures_are_rev );
+          SET arch_str = g("not %s", arch_str) IF ( arch_str && architectures_are_rev );
           SET arch_str = " [$arch_str]" IF arch_str;
            pkg_esc = uri_escape(pkg)  %]
        <a href="[% make_url(pkg_esc,'','suite',suite,'arch','') %]">[% pkg | html %]</a>[% arch_str %][% ', ' UNLESS loop.last %]
@@ -115,14 +122,14 @@ Please consider using a longer keyword or more keywords.</p>
 [% END %]
 
 [% IF results.size > 20 %]
-<tr><th>File</th><th>Packages</th></tr>
+<tr><th>[% g('File') %]</th><th>[% g('Packages') %]</th></tr>
 [% END %]
 </table>
 </div>
 
 [% ELSE %]
 
-<p id="psearchnoresult">Sorry, your search gave no results</p>
+<p id="psearchnoresult">[% g('Sorry, your search gave no results') %]</p>
 
 [% END %]
 
index 1d9f655eb3835620a78696cfe53ef6e473395520..082079efcd7f0e76b3784a65337e87ef3acaaa57 100644 (file)
 -%]
 [%- suite_name = suite;
     SET suite_name = suite_name _ ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite;
-    nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','source',''), name=>suite_name }, ];
-    nav_arr.push( { title => 'Source packages', url=>make_url('/'), name=>'Source' } ) IF is_source;
-    nav_arr.push( { prefix=>'Section:', title=>'All packages in this section', url=>make_url("$subsection/"), name=>subsection } );
-    nav_arr.push( { prefix=>'Package:', name=>pkg } ); -%]
+    nav_arr = [ { prefix=>g('Distribution:'), title=>g('Overview over this suite'), url=>make_url('/','','source',''), name=>suite_name }, ];
+    nav_arr.push( { title =>g('Source packages'), url=>make_url('/'), name=>g('Source') } ) IF is_source;
+    nav_arr.push( { prefix=>g('Section:'), title=>g('All packages in this section'), url=>make_url("$subsection/"), name=>subsection } );
+    nav_arr.push( { prefix=>g('Package:'), name=>pkg } ); -%]
 [% desclang = 'en';
    SET desclang = lang IF desc.$lang.long %]
 [%- PROCESS 'html/head.tmpl'
-   title_tag = ( is_source ? "Details of source package $pkg in $suite"
-                          : "Details of package $pkg in $suite" )
+   title_tag = is_source ? g('Details of source package %s in %s', pkg, suite)
+                        : g('Details of package %s in %s', pkg, suite)
    description = desc.$desclang.short
    keywords = "$suite, $archive, $section, $subsection, $version"
    print_search_field = 'packages'
 
 [% IF src %]
 <div id="psource">
-[% PROCESS menuitem prefix='Source:' title='Source package building this package' url=make_url(src.pkg,'','source','source') name=src.pkg %]
+[% PROCESS menuitem prefix=g('Source:') title=g('Source package building this package') url=make_url(src.pkg,'','source','source') name=src.pkg %]
 </div>
 [% END %]
 
 [%- PROCESS 'html/messages.tmpl' -%]
 
 [% IF is_virtual %]
-<h1>Virtual Package: [% pkg %]
+<h1>[% g('Virtual Package: %s', pkg) %]
 [% ELSIF is_source %]
-<h1>Source Package: [% pkg %] ([% version %])
+<h1>[% g('Source Package: %s (%s)', pkg, version) %]
 [% ELSE %]
-<h1>Package: [% pkg %] ([% versions.short %])
+<h1>[% g('Package: %s (%s)', pkg, versions.short) %]
 [% END %]
 [%- PROCESS marker text=archive IF archive && archive != main_archive %]
 [%- PROCESS marker text=section IF section && section != main_section %]
-[%- PROCESS marker text='essential' IF page.get_newest('essential') == 'yes' %]</h1>
+[%- PROCESS marker text=g('essential') IF page.get_newest('essential') == 'yes' %]</h1>
 
 [% UNLESS is_virtual %]
 <div id="pmoreinfo">
-<h2>Links for [% pkg %]</h2>
-<h3>Debian Resources:</h3>
+<h2>[% g('Links for %s', pkg) %]</h2>
+<h3>[% g('Debian Resources:') %]</h3>
 <ul>
-<li><a href="[% (is_source ? src_bugs_url : bugs_url) _ pkg | uri %]">Bug Reports</a></li>
+<li><a href="[% (is_source ? src_bugs_url : bugs_url) _ pkg | uri %]">[% g('Bug Reports') %]</a></li>
 
 [% IF src.pkg -%]
-<li><a href="[% pts_url _ src.pkg | uri %]">Developer Information (PTS)</a></li>
+<li><a href="[% pts_url _ src.pkg | uri %]">g('Developer Information (PTS)') %]</a></li>
 [% ELSIF is_source %]
-<li><a href="[% pts_url _ pkg | uri %]">Developer Information (PTS)</a></li>
+<li><a href="[% pts_url _ pkg | uri %]">g('Developer Information (PTS)') %]</a></li>
 [%- END %]
 
 [% IF files && (!archive or archive == main_archive or archive == 'security') %]
-<li><a href="[% changelogs_url _ files.changelog.path %]">Debian Changelog</a></li>
-<li><a href="[% changelogs_url _ files.copyright.path %]">Copyright File</a></li>
+<li><a href="[% changelogs_url _ files.changelog.path %]">[% g('%s Changelog', organisation) %]</a></li>
+<li><a href="[% changelogs_url _ files.copyright.path %]">[% g('Copyright File') %]</a></li>
 [% END %]
 
 [% IF vcs_link %]
-<li><a href="[% vcs_link %]" class="pvcslink">Debian Source Repository</a>
+<li><a href="[% vcs_link %]" class="pvcslink">[% g('Debian Source Repository') %]</a>
 [%- FOREACH vcs IN known_vcs;
        vcs_id = vcs.0; vcs_name = vcs.1; vcs_pkg = vcs.2;
        vcs_info = page.get_newest("vcs-$vcs_id");
 </ul>
 
 [% IF src %]
-  <p>Download Source Package <a href="[% src.url %]">[% src.pkg %]</a>:
+  <p>[% g('Download Source Package <a href="%s">%s</a>:', src.url, src.pkg) %]
   [% FOREACH src.downloads %]
     [% '<ul>' IF loop.first %]
     <li><a href="[% server _ path %]">[[% name %]]</a></li>
     [% '</ul>' IF loop.last %]
   [% END %]
   [% IF src.downloads.size == 0 %]
-  Not found
+  [% g('Not found') %]
   [% END %]
 [% END %]
 
 [% IF maintainers.size == 1 -%]
-  <h3>Maintainer:</h3>
+  <h3>[% g('Maintainer:') %]</h3>
 [%- ELSE -%]
-  <h3>Maintainers:</h3>
+  <h3>[% g('Maintainers:') %]</h3>
 [%- END %]
 [%- FOREACH maintainers -%]
   [%- '<ul>' IF loop.first -%]
        <li><a href="mailto:[% mail %]">[% name | html %]</a>
-       (<a href="[% ddpo_url _ mail %]" title="An overview over the maintainer's packages and uploads">QA Page</a>)
+       (<a href="[% ddpo_url _ mail %]" title="[% g("An overview over the maintainer's packages and uploads") %]">[% g('QA Page') %]</a>)
        </li>
   [%- '</ul>' IF loop.last -%]
 [%- END -%]
 [% url = page.get_newest('url');
    SET url = page.get_newest('homepage') IF page.get_newest('homepage');
    IF url %]
-<h3>External Resources:</h3>
+<h3>[% g('External Resources:') %]</h3>
 <ul>
-<li><a href="[% url | uri %]">Homepage</a> [[% extract_host(url) %]]</li>
+<li><a href="[% url | uri %]">[% g('Homepage') %]</a> [[% extract_host(url) %]]</li>
 </ul>
 [% END %]
 
 [% FOREACH sim IN similar %]
        [% IF loop.first %]
-       <h3>Similar packages:</h3>
+       <h3>[% g('Similar packages:') %]</h3>
        <ul>
        [% END %]
        <li><a href="/[% sim %]">[% sim %]</a></li>
 <div class="pconstantnag">
 [% IF suite == "experimental" %]
 [% changelog_link = 'changelog';
-   changelog_link = "<a href='$changelogs_url$files.changelog.path'>changelog</a>" %] 
-<h2>Experimental package</h2>
-<p>Warning: This package is from the <strong>experimental</strong> distribution.
+   changelog_link = "$changelogs_url$files.changelog.path" %] 
+<h2>[% g('Experimental package') %]</h2>
+<p>[% g('Warning: This package is from the <strong>experimental</strong> distribution.
 That means it is likely unstable or buggy, and it may even cause data loss.
-Please be sure to consult the [% changelog_link %] and other possible documentation before
-using it.</p>
+Please be sure to consult the <a href="%s">changelog</a> and other possible documentation before
+using it.', changelog_link) %]</p>
 [% END %]
 [% IF subsection == "debian-installer" %]
-<h2>debian-installer udeb package</h2>
-<p>Warning: This package is intended for the use in building
+<h2>[% g('debian-installer udeb package') %]</h2>
+<p>[% g('Warning: This package is intended for the use in building
 <a href="http://www.debian.org/devel/debian-installer">debian-installer</a> images only.
-Do not install it on a normal Debian system.</p>
+Do not install it on a normal %s system.', organisation ) %]</p>
 [% END %]
 </div>
 [% END %]
@@ -169,14 +169,15 @@ Do not install it on a normal Debian system.</p>
        <p>[% desc.$desclang.long %]
        [% END %]
 [% ELSE %]
-       <p>This is a <em>virtual package</em>. See the <a href="[% policy_url %]">Debian policy</a> for a <a href="[% policy_url %]ch-binary.html#s-virtual_pkg">definition of virtual packages</a>.</p>
+       <p>[% g('This is a <em>virtual package</em>. See the <a href="%s">Debian policy</a> for a <a href="%sch-binary.html#s-virtual_pkg">definition of virtual packages</a>.',
+               policy_url, policy_url) %]</p>
 [% END %]
 </div> <!-- end pdesc -->
 
 [% FOREACH tag IN tags %]
   [% IF loop.first -%]
     <div id="ptags"><p>
-    <a href="[% tags_url %]edit.html?pkg=[% pkg | uri %]">Tags</a>:
+    <a href="[% tags_url %]edit.html?pkg=[% pkg | uri %]">[% g('Tags') %]</a>:
   [%- END %]
   [% facet = tag.0;
      facet_name = debtags_voc.$facet;
@@ -197,7 +198,7 @@ Do not install it on a normal Debian system.</p>
 [% END %]
 
 [% FOREACH providers %]
-  [% IF loop.first %]<div id="pdeps"><h2>Packages providing [% pkg %]</h2><dl>[% END %]
+  [% IF loop.first %]<div id="pdeps"><h2>[% g('Packages providing %s', pkg) %]</h2><dl>[% END %]
     <dt>[% IF available %]<a href="[% make_url(name,'','source','') %]">[% name %]</a>[% ELSE %][% name %][% END %]</dt>
     <dd>[% desc %]</dd>
   [% '</dl></div>' IF loop.last %]
@@ -206,7 +207,7 @@ Do not install it on a normal Debian system.</p>
 [% END %]
 
 [% FOREACH binaries %]
-  [% IF loop.first %]<div id="pbinaries">The following binary packages are built from this source package:<dl>[% END %]
+  [% IF loop.first %]<div id="pbinaries">[% g('The following binary packages are built from this source package:') %]<dl>[% END %]
     <dt>[% IF available %]<a href="[% make_url(name,'','source','') %]">[% name %]</a>[% ELSE %][% name %][% END %]</dt>
     <dd>[% desc %]</dd>    
   [% '</dl></div>' IF loop.last %]
@@ -215,7 +216,7 @@ Do not install it on a normal Debian system.</p>
 [% FOREACH relations %]
   [% IF loop.first -%]
     <div id="pdeps">
-    <h2>Other Packages Related to [% pkg %]</h2>
+    <h2>[% g('Other Packages Related to %s', pkg) %]</h2>
 
     <table id="pdeplegend" class="visual" summary="legend"><tr>
     [% IF is_source %]
@@ -241,11 +242,11 @@ Do not install it on a normal Debian system.</p>
       [%- IF !is_old_pkgs -%]
         <dd>[% desc -%]
         [%- IF providers.pkgs.size > 0 -%]
-          [% '<br>also a ' IF providers.also %]virtual package provided by
+          [% '<br>also a ' IF providers.also %][% g('virtual package provided by') %]
          [% js_id = name %]
            <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]">[% FOREACH provider IN providers.pkgs %]<a href="[% make_url(provider,'','suite',suite,'source','') %]">[% provider %]</a>[% ', ' UNLESS loop.last %][% END %]</span>
        [% IF providers.pkgs.size > 10 %]
-       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% providers.pkgs.size %] providing packages")</script>
+       <script type="text/javascript">init_toggle_elem("[% js_id %]",[% g('%u providing packages', providers.pkgs.size) %]</script>
        [% END %]
         [% END %]
         </dd>
@@ -265,16 +266,21 @@ Do not install it on a normal Debian system.</p>
     <div id="pdownload">
     <h2>Download [% pkg %]</h2>
     
-    <table summary="The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.">
-    <caption class="hidecss">Download for all available architectures</caption>
-    <tr><th>Architecture</th>[% '<th>Version</th>' IF versions.multiple %]<th>Package Size</th><th>Installed Size</th><th>Files</th></tr>
+    <table summary="[% g('The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.') %]">
+    <caption class="hidecss">[% g('Download for all available architectures') %]</caption>
+    <tr><th>[% g('Architecture') %]</th>
+       [% '<th>'_ g('Version') _'</th>' IF versions.multiple %]
+       <th>[% g('Package Size') %]</th>
+       <th>[% g('Installed Size') %]</th>
+       <th>[% g('Files') %]</th>
+    </tr>
   [%- END %]
 
 <tr>
 [% download_url = pkg _ '/' _ d.arch _ '/download'
    filelist_url = pkg _ '/' _ d.arch _ '/filelist' %]
 <th><a href="[% make_url(download_url) | uri %]">[% d.arch %]</a>
-[%- SET a = d.archive; IF mirrors.$a.unofficial_port  %] <strong>(unofficial port)</strong>[% END %]</th>
+[%- SET a = d.archive; IF mirrors.$a.unofficial_port  %] <strong>[% g('(unofficial port)') %]</strong>[% END %]</th>
 [% vnorm = d.version.replace( '\+b\d+$', '' ); vlatest = version.replace( '\+b\d+$', '' );
    vup = vnorm.replace( '-[^-]+$', '' ); vuplatest = vlatest.replace( '-[^-]+$', '' );
    IF vnorm == vlatest;
@@ -285,12 +291,12 @@ Do not install it on a normal Debian system.</p>
        version_class = 'vold';
    END %]
 [% "<td class='$version_class'>$d.version</td>" IF versions.multiple %]
-<td class="size">[% d.pkgsize %]&nbsp;kB</td><td class="size">[% d.instsize %]&nbsp;kB</td>
+<td class="size">[% g('%.1f&nbsp;kB', d.pkgsize) %]</td><td class="size">[% g('%u&nbsp;kB', d.instsize) %]</td>
 <td>
 [% IF d.contents_avail %]
-  [<a href="[% make_url(filelist_url) | uri %]">list of files</a>]
+  [<a href="[% make_url(filelist_url) | uri %]">[% g('list of files') %]</a>]
 [% ELSE %]
-  no current information
+  [% g('no current information') %]
 [% END %]
 </td>
 </tr>
@@ -307,13 +313,13 @@ Do not install it on a normal Debian system.</p>
     <div id="pdownload">
     <h2>Download [% pkg %]</h2>
     
-    <table summary="Download information for the files of this source package">
-    <tr><th>File</th><th>Size (in kB)</th><th>md5sum</th></tr>
+    <table summary="[% g('Download information for the files of this source package') %]">
+    <tr><th>[% g('File') %]</th><th>[% g('Size (in kB)') %]</th><th>[% g('MD5 checksum') %]</th></tr>
   [%- END %]
 
 <tr>
 <td><a href="[% server _ path %]">[% filename %]</a></td>
-<td>[% size %]</td>
+<td>[% g('%.1f&nbsp;kB', size) %]</td>
 <td class="md5sum">[% md5sum %]</td>
 </tr>
 
@@ -326,10 +332,11 @@ Do not install it on a normal Debian system.</p>
        SET vcs_info = page.get_newest("x-vcs-$vcs_id") UNLESS vcs_info;
        IF vcs_info; %]
 <dl>
-<dt>Debian Package Source Repository (<acronym title="Version Control System">VCS</acronym>: <a href="[% make_url(vcs_pkg,'','source','') %]">[% vcs_name %]</a>)</dt>
+<dt>[% g('Debian Package Source Repository (<acronym title="Version Control System">VCS</acronym>: <a href="%s">%s</a>)',
+       make_url(vcs_pkg,'','source',''), vcs_name ) %]</dt>
 <dd><a href="[% vcs_info %]" class="pvcslink">[% vcs_info %]</a></dd>
 [% IF vcs_link %]
-<dt>Debian Package Source Repository (Browsable)</dt><dd><a href="[% vcs_link %]" class="pvcslink">[% vcs_link %]</a></dd>
+<dt>[% g('Debian Package Source Repository (Browsable)') %]</dt><dd><a href="[% vcs_link %]" class="pvcslink">[% vcs_link %]</a></dd>
 [% END %]
 </dl>
 [% END; END %]
index 465c6930ae0e125483a3a7e78b310457e4f10f2a..baf70e4c4c6d2cb59aadc321b54d1579bab6588e 100644 (file)
@@ -1,8 +1,8 @@
 [% nav_arr = [ { name=> suite, url=>make_url('/','','suite',suite) } ];
-   nav_arr.push( { name => 'Source' } ) IF source;
-   nav_arr.push( { name => 'Index' } );
+   nav_arr.push( { name => g('Source') } ) IF source;
+   nav_arr.push( { name => g('Index') } );
    PROCESS 'html/head.tmpl' 
-       title_tag = "List of sections in \"$suite\""
+       title_tag = g('List of sections in "%s"', suite)
        keywords = suite
        navigation = nav_arr
 %]
@@ -17,7 +17,7 @@
    [%- '</div>' IF loop.last -%]
 [% END %]
 
-<h1>List of sections in "[% suite %]"</h1>
+<h1>[% g('List of sections in "%s"', suite) %]</h1>
 
 [% FOREACH subsections %]
   [% '<div id="lefthalfcol"><dl>' IF loop.first %]
   [% '</dl></div>' IF loop.last %]
 [% END %]
 
+[% link_title = is_source ? g('List of all source packages')
+                         : g('List of all packages');
+   link_text = is_source ? g('All source packages')
+                        : g('All packages');
+-%]
 <p class="psmallcenter">
-       <a href="allpackages" title="List of all [% "source " IF source %]packages">All [% "source " IF source %]packages</a><br>
-       (<a href="allpackages?format=txt.gz">compact compressed textlist</a>)
+       <a href="allpackages" title="[% link_title %]">[% link_text %]</a><br>
+       (<a href="allpackages?format=txt.gz">[% g('compact compressed textlist') %]</a>)
 </p>
 
 [%- PROCESS 'html/foot.tmpl' -%]
index 1df4853cbfe0a82d3d275fd34bfe2c7961d44db6..5f84c5e608c7a79ceb443b37e4082ae8f1602fce 100644 (file)
@@ -1,13 +1,13 @@
 [% PROCESS 'html/head.tmpl' 
-       title_tag = "Overview of available Debian Package Tags"
+       title_tag = g("Overview of available Debian Package Tags")
        keywords = debtags
-       navigation = [  { name=>'About', url=>"/about/" },
-                       { name=>'Debtags' } ]
+       navigation = [  { name=>g('About'), url=>"/about/" },
+                       { name=>g('Debtags') } ]
 %]
-<h1>Overview of available Debian Package Tags</h1>
+<h1>[% g('Overview of available Debian Package Tags') %]</h1>
 
 [% FOREACH facet IN facets %]
-       <h2 id="[% string2id(facet) %]">Facet: [% facet %]</h2>
+       <h2 id="[% string2id(facet) %]">[% g('Facet: %s', facet) %]</h2>
        <p class="pshortdesc">[% vocabulary.$facet.html_description.0 %]</p>
        <p>[% vocabulary.$facet.html_description.1 %]
 
index 476202d3abe42b5cdfa0195f45355f372668a85d..4735c4423848e97611f919f8e3dc595f26e79c49 100644 (file)
     SET root_url = "$root_url$section/" IF section -%]
 
 <channel rdf:about="[% root_url %]newpkg">
-<title>New [% organisation %] Packages</title>
+<title>[% g('New %s Packages', organisation) %]</title>
 <link>[% root_url %]newpkg</link>
-<description>Packages that were added to the [% suite %] [% organisation %] archive [% " (section \"$section\")" IF section %] during the last 7 days.</description>
-<dc:language>en</dc:language>
-<dc:rights>Copyright [% timestamp.year %], [% copyright.name %]</dc:rights>
+<description>
+[%- IF section; 
+       g('Packages that were added to the %s %s archive (section "%s") during the last 7 days.',
+       suite, organisation, section);
+    ELSE;
+       g('Packages that were added to the %s %s archive during the last 7 days.',
+       suite, organisation, section);
+    END; -%]
+</description>
+<dc:language>[% lang %]</dc:language>
+<dc:rights>[% g('Copyright ©') %] [% timestamp.year %], [% copyright.name %]</dc:rights>
 <dc:date>[% rss_timestamp %]</dc:date>
 <dc:publisher>[% contact.mail %]</dc:publisher>
 <syn:updatePeriod>weekly</syn:updatePeriod>
index 12e249cc6b081ebd1d552bd0c44047b6bf53b9d5..226f03efa9715fbfb02200bc0653faf6a0f368e1 100644 (file)
@@ -1,9 +1,9 @@
 [%- PROCESS 'config/archive_layout.tmpl' -%]
-All Debian Packages in "[% suite %]"
+[% g('All %s Packages in "%s"', organisation, suite) %]
 
-Last Modified: [% timestamp.string %]
-Copyright (C) [% copyright.years %] [% copyright.name %];
-See <URL:[% license.url %]> for the license terms.
+[% g('Generated:') _ ' ' _ timestamp.string %]
+[% g('Copyright ©') _ ' ' _ copyright.years _ ' ' _ copyright.name %];
+[% g('See <URL:%s> for the license terms.', license.url) %]
 
 [% FOREACH packages -%]
   [%- BLOCK marker %] [[% text %]][% END -%]
@@ -12,7 +12,7 @@ See <URL:[% license.url %]> for the license terms.
     [%- PROCESS marker text=archive IF archive != main_archive -%]
   [%- END -%]
   [%- IF providers.size %]
-[% name %] virtual package provided by [% providers.join(', ') %]
+[% name %] [% g('virtual package provided by') _ ' ' _ providers.join(', ') %]
   [%- END -%]
   [%- IF versions %]
 [% name %] ([% versions %])[% PROCESS markers %] [% desc %]