]> git.deb.at Git - deb/packages.git/commitdiff
Always show polangs in footer
authorFrank Lichtenheld <frank@lichtenheld.de>
Sat, 20 Oct 2007 17:16:23 +0000 (19:16 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sat, 20 Oct 2007 19:53:21 +0000 (21:53 +0200)
Since we have now working l10n support, we should at least
offer all polangs as alternatives. This is not fully ideal
since for some languages we only have translations for a
few templates, but everything else is probably too complicated.

lib/Packages/DoShow.pm
lib/Packages/Template.pm

index 92b69e59718be617d87373983f9d9248edcc8b92..38b34fbe2abc736c37447a26e8c9db016ed47c4e 100644 (file)
@@ -12,7 +12,8 @@ use Exporter;
 
 use Deb::Versions;
 use Packages::Config qw( $DBDIR @SUITES @ARCHIVES @SECTIONS
-                        @ARCHITECTURES %FTP_SITES @DDTP_LANGUAGES);
+                        @ARCHITECTURES %FTP_SITES
+                        @LANGUAGES @DDTP_LANGUAGES);
 use Packages::I18N::Locale;
 use Packages::CGI qw( :DEFAULT make_url make_search_url );
 use Packages::DB;
@@ -179,7 +180,8 @@ sub do_show {
                        my $trans_desc = $desctrans{$desc_md5};
                        if ($trans_desc) {
                            my %trans_desc = split /\000|\001/, $trans_desc;
-                           $contents{used_langs} = ['en', sort keys %trans_desc];
+                           my %all_langs = map { $_ => 1 } (@LANGUAGES, keys %trans_desc);
+                           $contents{used_langs} = [ keys %all_langs ];
                            debug( "TRANSLATIONS: ".join(" ",keys %trans_desc), 2)
                                if DEBUG;
                            while (my ($l, $d) = each %trans_desc) {
index be71d154ffbcaf890d8e0fc8cec583e90a5ade81..8fb22b55638e1c8e85f5969a047e0c07357c3659 100644 (file)
@@ -11,6 +11,7 @@ use URI::Escape ();
 use Benchmark ':hireswallclock';
 
 use Packages::CGI;
+use Packages::Config qw( @LANGUAGES );
 use Packages::I18N::Locale;
 use Packages::I18N::Languages;
 use Packages::I18N::LanguageNames;
@@ -74,7 +75,7 @@ sub page {
 
     #use Data::Dumper;
     #die Dumper($self, $action, $page_content);
-    $page_content->{used_langs} ||= [ 'en' ];
+    $page_content->{used_langs} ||= \@LANGUAGES;
     $page_content->{langs} = languages( $page_content->{lang}
                                        || $self->{vars}{lang} || 'en',
                                        @{$page_content->{used_langs}} );