[sugj-tech:1840] SWAT internatinalization project is working

Ryo Kawahara rkawa at lbe.co.jp
Sun Oct 8 14:09:29 GMT 2000


Hello,...I'm making "internationalized" SWAT patch for 2.2.

----- Original Message -----
From: Hiroshi MIURA <miura at samba.gr.jp>
To: <samba-technical at samba.org>
Cc: <sugj-tech at samba.gr.jp>
Sent: Sunday, October 08, 2000 4:12 PM
Subject: [sugj-tech:1840] SWAT internatinalization project is working


> Hi,
>
> I and Ryo Kawahara who is the members of Samba User Group Japan
> are developing SWAT internationalization(I18N) using GNU gettext library.
>
> What is this feature?
> A browser like Netscape or Internet Explorer on client send the
> language negotiation data to the server.
> ie.  accept-language: en ja fr ...

lynx , w3m and Amaya brosers are also able to send this http/1.1 header, so
I think
many users can use this functionality.

> There are language catalogs and documents translated to local languages,
> Swat select it and send to client.

I added the code to SWAT that parses "Accept-Language" header and returns
the translated
version of documents, and change languages of SWAT output messages used in
forms,
buttons, parameter names, etc. Users can easily get information in their
languages if there are trancelated data.
Adding new translated documents is easy. Just copy the document to
(language code)/help/foo.html
where language code is like ja, en, de.
I used gettext library to change the output messages of SWAT, so it is able
to add a new language
by adding the (language).po (called message catalog) file.

> see ->     http://www.samba.gr.jp/project/samba-ja/index.html.en
>
> Now we are working about the portablity issue and integrating with
> Samba-2.2 branch.

> For the portability, we tested some implimantation as follows:
>
> 1. implemented in Samba-2.0.7-ja-1.0 to ja-1.3.
>
>    this use configure to decide where to install catalog file and
>    which method is good whether GNU gettext installed in OS or
>    XPG4 catgets installed in the OS or GNU gettext bandled with Samba.
>
>    it is confiured by ./configure --with-swat-i18n
>    and with --with-catgets or --with-included-gettext or none.
>
> 2. implemented in Samba-2.0.7-ja-2.0(Now prepare for release)
>
>    Especially, --with-catgets is less portable
than --with-included-gettext.
>    And there are so many codes handling catgets catalog.
>
>    So We are working only supports the bandled library for portability.
>
>    Now only --with-swat-i18n is needed.

Portability was the biggest problem. First I was going to use i18n library
on the OSes
such as GNU gettex, Sun gettext, XPG4 catgets interfaces, but they need
locale data
to change languages and locale data is very system dependent thing. That way
is not
good for web application like SWAT. Many tests has done by SUGJ (samba users
group japan)
and in Samba-2.0.7-ja-2.0, now SWAT supports GNU gettext only. It is
included in the archive of
samba-2.0.7-ja-2.0 and ready to compile. (we have Makefiles and configure
script for that).
This library has already been used in many platforms so I think it has a
good portability.
samba-2.0.7-ja-2.0 release candidate version has been tested on Linux,
FreeBSD, Solaris8,
HP-UX11, and some other OS.
In this version, SWAT doesn't requires specific locale data to change
languages.

Now I'm making the patch for samba-2.2 and maybe work will done in about one
week.
Maybe this patch will help non-english users, I hope.
How do you think about this?

/////////////////////////////////
// Ryo Kawahara
// http://www3.lbe.co.jp/~rkawa/






More information about the samba-technical mailing list