[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Instructions for localizing glimpse
Hi Golda,
here are the exact instructions for localizing Glimpse. This should take
care of the case-sensitivity problems that your Danish user saw. They
really fall into two parts. One is platform-independent, the other one is
platform-dependent.
Please note also the suggestion at the end of these instructions on how to
reconfigure the
language/locale on a per-search basis. That should be very useful for
multilingual sites.
The platform-independent part:
==============================
These instructions are for glimpse-4.11.
You have to make sure that glimpse is compiled with locales enabled. This
option is controlled by the ISO_CHAR_SET preprocessor define. It has to be
defined as 1. Most of the platform-specific Makefiles define it to be 0;
hence you have to edit the Makefile the you are using in the glimpse root
directory and change the line
ISO_CHAR_SET = 0
to
ISO_CHAR_SET = 1
or add it if it does not exist at all. I am not sure whether it is
necessary to edit the Makefiles in the subdirectories as well. At least in
the case of the Linux Makefile, eit is not necessary.
Now do a make -f <your makefile> clean followed by a make -f <your
makefile> to rebuild the glimpse tools. Then install them.
The platform-dependent part:
============================
It is also necessary to configure the locale on your host computer
correctly. As far as I know, this is platform-specific, so I can show how
to do this only for a Linux libc6 installation. Other platforms should be
relatively similar, though.
First, make sure that the desired locale is installed on the host computer.
You can find it in /usr/share/locale/<locale-name>. For a German locale,
the desired locale name is de_DE. For a Danish locale, my best guess is
that it should be da_DK. In any case, the files LC_CTYPE and possibly
LC_COLLATE must exist in the subdirectory for this locale name; otherwise
it will not be very useful.
If the locale exists, set the LANG and LC_CTYPE environment variables to
the locale name. For example, to select the German locale:
export LANG=de_DE
export LC_CTYPE=de_DE
These environment variables must always be set before running wgreindex and
glimpse (via webglimpse).
Now run wgreindex to recreate the archive with the correct locale. (So,
shouldn't we set these environment variables in wgreindex?)
You may also have to restart the httpd with the environment variables set
to the correct locales. Or you can follow my suggestion below.
Suggestion:
===========
It should be pretty straightforward to extend Webglimpse to be able to
switch between different
locales on a per-search basis. All you really have to do is set the
environment variables in the CGI script. I am just not sure if it is
possible to do this in a platform-independent way. On my Linux box, adding
these two lines to webglimpse did the trick for a German locale:
$ENV{'LANG'} = 'de_DE';
$ENV{'LC_ALL'} = 'de_DE';
It should be easy to pass the locale as an argument to the CGI script.
Regards,
- Christian