[luatex] Translating TeX (obviously a feature request).

Paul Isambert zappathustra at free.fr
Sun Aug 1 13:39:23 CEST 2010


Selon Khaled Hosny <khaledhosny at eglug.org>:

> On Sun, Aug 01, 2010 at 12:54:03PM +0200, Taco Hoekwater wrote:
> >
> > Hi,
> >
> > On 08/01/2010 12:06 PM, Khaled Hosny wrote:
> > >On Sun, Aug 01, 2010 at 11:46:15AM +0200, Paul Isambert wrote:
> > >>Hello all,
> > >>
> > >>Since LuaTeX reaches down to TeX's most intimate parts (its bowels, of
> course),
> > >>I was wondering whether there is any plan to give access to TeX's
> messages,...
> > >>
> > >>tex.internal_error("undefined_cs","Commande non définie")
> > >>
> > >>would replace TeX's "Undefined control sequence" by the French
> message....
> > >
> > >I was thinking about localising TeX a while ago too, but I was thinking
> > >in a more conventional way: using GNU gettext to localise TeX messages,
> ...
> >
> > I am not a big fan of using gettext() because it is a nightmare on
> > Windows. But also, errors in TeX do not have names, and sometimes
> > the help text is the only difference between certain errors.
>
> I was also wondering how usable is gettext on Windows.
>
> > My actual plan is to create a callback function in luatex to actually
> > report the error to the user, and give to that function the formal
> > error message and the error help as arguments, as well as a hint
> > on how to handle user feedback. That way, lua code will be able
> > to hook in whatever translation and/or user response that is needed
> > (but it needs quite a bit of internal luatex reshuffling so this
> > will probably be for luatex 0.80)
>
> One of the strength points of gettext is its ability to handle some
> relatively complex localisation tasks like plural forms or message
> context etc. So my be by then one can find some lua-gettext module to
> use :)

I have my doubts about gettext... because I don't know it :) (TeX is the only
language, if it is one, in which I can express myself rather clearly.) That's
not totally self-centered: TeX is hard enough, and with Lua on top of it  (or
below) it already becomes rather specialized, so I'll fear any additional
language will make it totally unreachable to most people, and I believe most
people should be able to use TeX more or less directly, for instance using
plain, and still benefit from what LuaTeX has to offer. So I vote for callbacks,
since it seems the easiest way around (a TeX primitive wouldn't be workable, I
suppose)and easily customizable by users.

Best,
Paul




More information about the luatex mailing list