Skip to main content.
home | support | download

Back to List Archive

Re: swish.cgi - Problem with HTML output

From: <moseley(at)not-real.hank.org>
Date: Mon Aug 11 2003 - 14:52:37 GMT
On Mon, Aug 11, 2003 at 09:05:29AM +0200, Bucharow Leonard wrote:
> 
> Hi Bill,
> 
> sorry that I write to you directly, but I have many days search in
> discussion forum and found no solution for my problem.

Well, this is a perfect question for the list since others will like 
have more experience with this.

> How could I edit the HTML output ???
> 
> I use swish.cgi and TemplateDefault.pm
> 
> I would translate the messages (f.e. "no results" or error messages) for
> german language, but I don' know, how could I do this.

That message comes from swish-e, not from any of the templating output.  
It would be great if swish-e had customizable text output.

For now, you could go into SWISH/TemplateDefault.pm and look for this 
section:

sub page_header {
    my $results = shift;
    my $title = $results->config('title') || 'Search our site with Swish-e';
    my $message = $results->errstr;

    $message = $message
        ? qq[<br><font color="red">$message</font>]
        : '' ;

And maybe do this instead:

    my $message = $results->errstr;

    $message =~ s/no results/whatever/;


    $message = $message
        ? qq[<br><font color="red">$message</font>]
        : '' ;

There's lots of options there. You might have a hash to search through 
for replacement strings, for example.

Hope this helps.


-- 
Bill Moseley
moseley@hank.org
Received on Mon Aug 11 14:57:00 2003