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

Khaled Hosny khaledhosny at eglug.org
Sun Aug 1 13:50:51 CEST 2010


On Sun, Aug 01, 2010 at 01:39:23PM +0200, Paul Isambert wrote:
> 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.

If you are going to do any moderate sized translation project, you will
appreciate using standard translation tools and file formats. Also
gettext is just a C library to help l10n your application, no additional
language or anything, though I admit it is more complex, code wise, than
writing some lua code, but that complexity is no where near the
complexity of maintain translation in a non-standard method. Trust me,
I've been doing localisation for years and only gettext seems to get it
right (to the degree that I convert any text I'm to translate to a PO
file, even plain text).

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the luatex mailing list