lua-users home
lua-l archive

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


Rob Kendrick wrote:
On Sun, 2005-09-11 at 10:52 -0300, Luiz Henrique de Figueiredo wrote:
> I think it's helpful to have all parser error messages in extern file
> for different languages and added to compilation via defines. Is it
> hard to release?

Support for messages in different languages is not simple because the
position of the varying parts may be different in different languages.
See GNU gettext for a tates of how hard this can be.

See the following article to see how *really hard* this can be...
http://search.cpan.org/dist/Locale-Maketext/lib/Locale/Maketext/TPJ13.pod

On a semi-related note, I noticed this problem too, and wrote my own
internationalisation library for a program I was working on at the time:

http://trac.rjek.com/index.cgi/file/colloquy/src/i18n.lua

Uses Lua 4.0, as it seems.

Interesting, althought I haven't yet decyphered it fully.
I am not even sure to understand what colloquy does...

I think it's pretty much over the top in every respect, although it's
not quite what I want yet.

It uses the powerful feature of Lua of being able to mix functions with plain data. That's nice.

The comment:
-- we can't use gsub here, because this may contain information from a user,
-- and as such might contain gsub magic characters.
will seem familiar to readers of a recent thread.
Note that since the Lua environment seems customized, you could have provided a substitute function. The main concern of users is that a plain gsub isn't available on stock Lua, which is still used a lot as generic interpreter.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --