hello,

disclaimer: please take this e-mail as README file to submited patch.

what is the patch doing:
------------------------
enabling htsearch to produce HTML content in more languages based on
setting in htdig.conf

whats the goal:
---------------
to be able to run htdig on one server for multiple virtual servers in more
than one language variation.

how it is done:
---------------
in htsearch configuration initialization 'language' option from config is
used to determine in which language htsearch should produce output. then
default config values are changed so they contain language specific
values.

all the user have to do is set 'language' option in htdig.conf ('en' and
'sk' are currently implemented) and also customize ${custom_dir}/*.html
files (of course). i added to 'contrib/lang/slovak' directory slovak
versions of those files (just translated standard files).

actual state:
-------------
for now only english language (as default) and slovak language (added by
me) is implemented.

new language can be imeplemented adding LangXX.{cc,h} files into
<src_dir>/htsearch and adding following lines to htsearch.cc

         #ifdef USE_LANG_SUPPORT
         #include "LangSk.h"
        +#include "LangXX.h"
         #endif

         if (strcmp(lang, "sk") == 0)
         {
             config.Defaults(&lang_sk[0]);
             known = 1;
         }
        +if (strcmp(lang, "xx") == 0)
        +{
        +    config.Defaults(&lang_xx[0]);
        +    known = 1;
        +}
         if (strcmp(lang, "en") == 0)

also <src_dir>/htsearch/Makefile.in should be updated (OBJS).

patch is done against htdig-3.1.3 .

the style of my changes is maybe not that good/cool/clean/... so i would
like to receive some corrections (prefered) or comments on this (in case
someone more concerned, more able and/or more potent about/in htdig
development wants to work on this, while my work is not limited to htdig
contribution :( ).

TODO
----

while slovak pages uses ISO-8859-2 encoding, i (or who? :) have to
implement also something like 'encoding' option (also set when making
language customization) so proper encodind/charset HTTP header is returned
to client.


well ... for now that's all (i'm tired, sorry).

i hope at least one person will consider it usefull and will use it.

sincerely

peter hanecak

p.s.: if someone is interested in RPM package of htdig with this patch, he
can find it at http://www.megaloman.com/~hany/RPM/htdig.html (btw doors
2.2 release is glibc2.1 based, doors 1.2 is based on glibc2.0 ).

===================================================================
  Peter Hanecak - production manager
  Mega & Loman, Stare grunty 52, 842 44 Bratislava, Slovakia
  tel., fax: +421-7-654 211 52
  [EMAIL PROTECTED], http://www.megaloman.com
  GPG pub.key: http://www.megaloman.com/gpg/hanecak-megaloman.txt
===================================================================

htdig-3.1.3-multilang.patch.gz

Reply via email to