r10380 - /man-cgi/man.cgi
Author: jfs
Date: Tue Mar 4 20:16:20 2014
New Revision: 10380
URL: http://svn.debian.org/wsvn/?sc=1&rev=10380
Log:
Improve HTML pages presented as part of errors by adding the same header as for other pages and
providing a more descriptive link.
Modified:
man-cgi/man.cgi
Modified: man-cgi/man.cgi
URL: http://svn.debian.org/wsvn/man-cgi/man.cgi?rev=10380&op=diff
==============================================================================
--- man-cgi/man.cgi (original)
+++ man-cgi/man.cgi Tue Mar 4 20:16:20 2014
@@ -322,7 +322,7 @@
$alttitle = $form{'title'};
$manpath = $form{'manpath'};
$locale = $form{'locale'};
- $locale = '' if $locale eq 'en'; # Default locale
+ $locale = '' if $locale eq 'en' or $locale eq 'C'; # Default locale
$encoding = '' ; # No encoding
if (!$manpath) {
$manpath = $manPathDefault;
@@ -497,7 +497,7 @@
if (!$acounter) {
print "Sorry, no data found for `$query' ($acounter).\n";
- print ¬_found('apropos',$section);
+ print ¬_found('apropos', $section, '', $query);
}
print "</DL>\n";
print &html_footer();
@@ -646,6 +646,7 @@
}
+
print "X $manpath - $locale - $manPath{$manpath} x\n" if $debug;
if ($manpath) {
if ($manPath{$manpath}) {
@@ -770,13 +771,19 @@
print qq{</PRE>\n<a name="end">\n<hr noshade>\n};
if ($outputlines == 0 ) {
print "X $command{'man'} @manargs -- $section $name x\n" if $debug;
+# Set locale to 'en' if we are not given a locale
+ $locale = "en" if !$locale;
print "Sorry, no data found for `$html_name" .
($html_section ? "($html_section)": '') . "' in language ".$locales{$locale}.".\n";
- print ¬_found('section',$html_section, $locale);
- if ( $locale) {
- print "You might want to try the ".
- qq{<A HREF="$BASE?query=$name&sektion=$section&apropos=0&manpath=$manpath">original (english)</A> version.\n};
- }
+ if ( $locale && $locale ne "en" ) {
+ print "You might want to try searching if there is a version of this manpage in ".
+ qq{<A HREF="$BASE?query=$name&sektion=$section&apropos=0&manpath=$manpath">English</A>.\n};
+ }
+ if ( $section ) {
+ print "Try broadening your search for the manpage looking ".
+ qq{<A HREF="$BASE?query=$name&sektion=&apropos=0&manpath=$manpath">in all sections</A>} . ".";
+ }
+ print ¬_found('section', $html_section, $locale, $query);
return;
}
Reply to: