Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Introduction; Looking for Help on i18n



(By the way, it's not clear to me whether you are subscribed to the
list; if you're getting two copies and it's annoying you, say so and
I'll stop sending to both.)

>>>>> "Kai" == Kai Wetzel <k.wetzel@example.com> writes:

    Kai> The LIP has to determine what we can provide in the library
    Kai> and what would be out of scope or is beeing worked on by
    Kai> other people.  I can't say much about this myself, since I
    Kai> only know that my Linux/X11 has vertially no support for
    Kai> anything outside of the "C" locale :(

This I can help with.  X11 intends to use the system's native locale
support, and by default locale support is provided by libc.  In order
to use the support provided by X11, you should do something like the
following in every module that requires locale support from Xlib:

#define X_LOCALE
#include <X11/Xlocale.h>

This substitutes X11's functions for libc's.  The database is in
/usr/X11R6/lib/X11/{i18n,locale,nls} some or all of which are symbolic 
links to each other.  This database is not compatible with the POSIX
format.  If you don't have that database, you're in trouble, of course.

This can also be done at runtime by use of the
"Netscrap_X11_liblocale.so" hack:  you make a wrapper function to
interface what libc functions will be calling to the _Xsetlocale
function.  Then run existing locale-ized programs such as Motif
programs with `LD_PRELOAD=/path/to/Netscrap_X11_liblocale.so proggy'.

These tricks both work with non-X programs, but you do have link
against Xlib, of course.  And if you're not running under X you may
have to provide facilities like fonts and input methods yourself.

I'd provide the code, but (a) I forget where I left it and (b) you
should figure this out for yourself anyway because the code used to
let Netscrap work with Japanese intentionally omits some locale
features, and you need to decide if that's appropriate.

    >> C/C++?  Support?  NOT.  There is some support for POSIX locales
    >> in Linux glibc, but no documentation I can find (I haven't
    >> looked that hard, and have not joined the ML, though)

    Kai> Well, there is e.g. the class "locale" and there seems to be
    Kai> some other facilities.  I don't know how complete they are
    Kai> and I don't know how much of them is usable in common
    Kai> implementations of the standard C++ library.

Right, but without the database they're nothing.  Some of the locale
data are shit^H^H^H^Halpha (I believe this is true for Korean);
without docs, you can't tell which are good.  And some locales have
simply gone missing and nothing is said about attempts to put them
together (eg, Japanese).

    Kai> Well, I think both is needed, extending existing classes as
    Kai> well as potentially introducing classes which are mainly
    Kai> there to provide i18n features.  Examples from the Java API
    Kai> would be Locale, Collation (was: "TCollator"), Date/Time
    Kai> formats (was: "formatter"), etc.  Of course some things may
    Kai> effect the core classes fundamentally, such as fonts.

I may be wrong, but I suspect that if you look closely you will see
that some or all of these classes are actually integrated into very
low levels of the API.  Of course you _need_ a locale class to manage
the various aspects of locale (for example, a Frenchman reading mail
from the US might very well want the currency symbol to be `$' but the
decimal separator to be `,', so custom locales will be necessary for
some cranky users).  But the fact that it's user-visible doesn't mean
that it doesn't go all the way to the root of the IO classes.  Again,
I think you have it backwards about fonts; the fonts actually come
last in the display pipeline:

   markup -> format dates, etc -> line-breaking by font metrics ->
			 display using fonts

and so can be grafted on at the last second.

Ciao.  Off to teach.

Steve
Next TLUG meeting is Saturday Dec. 13, 1997  (possibly Nov. 13?)
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links