From: Frank Lichtenheld Date: Sat, 20 Oct 2007 17:16:23 +0000 (+0200) Subject: Always show polangs in footer X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=2b31e222e12852e8f3ac6a9aa14ae684c1144b8e;p=deb%2Fpackages.git Always show polangs in footer 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. --- diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 92b69e5..38b34fb 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -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) { diff --git a/lib/Packages/Template.pm b/lib/Packages/Template.pm index be71d15..8fb22b5 100644 --- a/lib/Packages/Template.pm +++ b/lib/Packages/Template.pm @@ -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}} );