Peter Hanecak wrote:
> 
> 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.

Not quite sure.. but as I understand it, this can already be done 
solely based upon the template feature.  All you have to do for it
is to write one template and one config for each language - common
parts of the config can be shared using the include directive.
You can then switch languages by switching configuration files, which
is possible by using "allow_in_form: config".


cheers,
  Torsten

-- 
InWise - Wirtschaftlich-Wissenschaftlicher Internet Service GmbH
Waldhofstra�e 14                            Tel: +49-4101-403605
D-25474 Ellerbek                            Fax: +49-4101-403606
E-Mail: [EMAIL PROTECTED]            Internet: http://www.inwise.de

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to