A few patches to increase language config tags


Jesse op den Brouw (jesse@crytonII.st.hhs.nl)
Thu, 04 Dec 1997 18:46:14 +0100


Hello Andrew,

in my search for configuring htdig to be used with full dutch
sentences, I started to wonder why there was no way to set
[No title] to another string. So I took the liberty to dig in
the sources and patched the following files;

htcommon/defaults.cc
htsearch/Display.cc

I added to the first file a no_title_text config option (note also
that there are TWO page_list_header in the this file, so I removed
the first). Here is the patch for the first file:

--- defaults.cc.orig Fri Aug 15 07:59:25 1997
+++ defaults.cc Thu Dec 4 15:37:39 1997
@@ -82,7 +82,7 @@
     {"next_page_text", "[next]"},
     {"no_excerpt_text", "<em>(None of the search
words were found in the top of this document.)</em>"},
     {"no_next_page_text", "[next]"},
- {"page_list_header", ""},
+ {"no_title_text", "[No title]"},
     {"no_prev_page_text", "[prev]"},
     {"nothing_found_file", "${common_dir}/nomatch.html"},
     {"page_list_header", "<hr noshade
size=2>Pages:<br>"},

NOTE: you see: TWO times page_list_header

The second patch is to make some routine in Display.cc actualy use the
config.
Here is the patch:

--- Display.cc.orig Fri Aug 15 07:59:44 1997
+++ Display.cc Thu Dec 4 15:34:00 1997
@@ -160,9 +160,18 @@
     vars.Add("URL", new String(match->getURL()));
     vars.Add("SCORE", new String(form("%d", match->getScore())));
     char *title = ref->DocTitle();
+//
+// This was the original code
+//
+// if (!title || !*title)
+// title = "[No title]";
+// vars.Add("TITLE", new String(title));
+//
     if (!title || !*title)
- title = "[No title]";
+ vars.Add("TITLE", new String(config["no_title_text"]));
+ else
     vars.Add("TITLE", new String(title));
+
     vars.Add("STARSRIGHT", generateStars(ref, 1));
     vars.Add("STARSLEFT", generateStars(ref, 0));
     vars.Add("SIZE", new String(form("%d", ref->DocSize())));

You see: TITLE gets it's info from the config struct if the title is
empty.

I hope these patches are included in the next version. If you think
they should be on the htdig mailing list (please confirm if they are
working, I wouldn't dear to destroy anyone's htdig source), mail me
back.

In my htdig.conf file, I added a line:

no_title_text: [Geen titel]

which is of course the dutch version of No title. It seems to be
working here....

Greetings from cold Holland and merry x-mas.....

--jesse
---------------------------------------------------------------------
J. op den Brouw Johanna Westerdijkplein 75
Haagse Hogeschool 2521 EN DEN HAAG
Sector Techniek Netherlands
Afdeling Elektrotechniek +31 70 4458936
-------------------- J.E.J.opdenBrouw@st.hhs.nl ---------------------

Linux - because reboots are for hardware changes



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:25:24 PST