[Ocaml-i18n] Re: [Caml-list] Camomile-0.5.0

Richard Jones rich at annexia.org
Sat Jun 12 01:51:16 PDT 2004


Well I don't care for the silly philosophical arguments about whether
implicit state is bad or not.  What matters is that I can do something
to change the language before handling each request.  Each Apache
process handles hundreds of requests (not simultaneously, however),
and so needs to change the language hundreds of times.

Not having to pass around a variable helps.  eg. It's easier to write:

let string = gettext "This string will be translated" ...

Note that GNU gettext doesn't get this completely right.  After
setting LANG or LANGUAGE you need to do:

#ifdef __GLIBC__
  {
    extern int _nl_msg_cat_cntr;
    _nl_msg_cat_cntr++;
  }
#endif

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/



More information about the Ocaml-i18n mailing list