From 1cc237c732b99138c613a79c59db361f75f9dd71 Mon Sep 17 00:00:00 2001
From: Frank Lichtenheld \n/go;
+ $long_desc =~ s/(((\n|\A) [^\n]*)+)/\n \n/go;
- $long_desc =~ s/(((\n|\A) [^\n]*)+)/\n$1\n<\/pre>/sgo;
+
+ return ($short_desc, $long_desc);
+ }
+
my $desc = $descriptions{$did};
- $short_desc = encode_entities( $1, "<>&\"" )
- if $desc =~ s/^(.*)$//m;
- my $long_desc = encode_entities( $desc, "<>&\"" );
-
- $long_desc =~ s,((ftp|http|https)://[\S~-]+?/?)((\>\;)?[)]?[']?[:.\,]?(\s|$)),$1$3,go; # syntax highlighting -> '];
- $long_desc =~ s/\A //o;
- $long_desc =~ s/\n /\n/sgo;
- $long_desc =~ s/\n.\n/\n
$1\n<\/pre>/sgo;
-
- $contents{desc} = { short => $short_desc,
- long => $long_desc, };
+ my $long_desc;
+ ($short_desc, $long_desc) = process_description($desc);
+
+ $contents{desc}{en} = { short => $short_desc,
+ long => $long_desc, };
+
+ debug( "desc_md5=$desc_md5", 2)
+ if DEBUG;
+ my $trans_desc = $desctrans{$desc_md5};
+ if ($trans_desc) {
+ my %trans_desc = split /\000|\001/, $trans_desc;
+ debug( "TRANSLATIONS: ".join(" ",keys %trans_desc), 2)
+ if DEBUG;
+ while (my ($l, $d) = each %trans_desc) {
+ my ($short_t, $long_t) = process_description($d);
+
+ $contents{desc}{$l} = { short => $short_t,
+ long => $long_t, };
+ }
+ }
my $v_str = $version;
my $multiple_versions = grep { $_ ne $version } values %$versions;
diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl
index f2993ed..0ef593e 100644
--- a/templates/html/show.tmpl
+++ b/templates/html/show.tmpl
@@ -4,10 +4,12 @@
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 } ); -%]
+[% 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" )
- description = desc
+ description = desc.$desclang.short
keywords = "$suite, $archive, $section, $subsection, $version"
print_search_field = 'packages'
search_field_values = {
@@ -151,9 +153,9 @@ Do not install it on a normal Debian system.
[% desc.long %] + [% IF desc.$desclang.short %] +
[% desc.$desclang.long %] [% END %] [% ELSE %]
This is a virtual package. See the Debian policy for a definition of virtual packages.
-- 2.39.2