lua-users home
lua-l archive

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



-----Original Message-----
From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
Behalf Of lua-l-request@lists.lua.org
Sent: None
To: lua-l@lists.lua.org
Subject: lua-l Digest, Vol 67, Issue 39

Send lua-l mailing list submissions to
	lua-l@lists.lua.org

To subscribe or unsubscribe via the World Wide Web, visit
	
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/lua-l-lists.lua.or
g

or, via email, send a message with subject or body 'help' to
	lua-l-request@lists.lua.org

You can reach the person managing the list at
	lua-l-owner@lists.lua.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of lua-l digest..."


Today's Topics:

   1. Re: My program doesn't speak Portugese! (Philipp Janda)
   2. Re: Handling Translated Texts (i18n) (Xavier Wang)


----------------------------------------------------------------------

Message: 1
Date: Tue, 23 Feb 2016 23:57:32 +0100
From: Philipp Janda <siffiejoe@gmx.net>
Subject: Re: My program doesn't speak Portugese!
To: lua-l@lists.lua.org
Message-ID: <naio4s$rr2$1@ger.gmane.org>
Content-Type: text/plain; charset=UTF-8; format=flowed

Am 23.02.2016 um 23:00 schrC6bte Sean Conner:
>
>    It's not documented (at least, I didn't see it mentioned in the 
> description for io.open() for Lua 5.1, 5.2 or 5.3), but Lua does 
> return a third parameter for io.open():

For Lua 5.1: http://www.lua.org/manual/5.1/manual.html#5.7
For Lua 5.2: http://www.lua.org/manual/5.2/manual.html#6.8
For Lua 5.3: http://www.lua.org/manual/5.3/manual.html#6.8

> Unless otherwise stated, all I/O functions return nil on failure (plus 
> an error message as a second result and a system-dependent error code 
> as a third result) and some value different from nil on success. On 
> non-POSIX systems, the computation of the error message and error code 
> in case of errors may be not thread safe, because they rely on the 
> global C variable errno.

The weird thing is that the entry for `io.open` *does* state otherwise:

> This function opens a file, in the mode specified in the string mode.
> It returns a new file handle, or, in case of errors, nil plus an error 
> message.

Philipp





------------------------------

Message: 2
Date: Wed, 24 Feb 2016 19:46:10 +0800
From: Xavier Wang <weasley.wx@gmail.com>
Subject: Re: Handling Translated Texts (i18n)
To: Lua mailing list <lua-l@lists.lua.org>
Message-ID:
	<CAPsVyB98imjf=pZS4f11Q4qhMAD4RO7G00CsaGGW_=MJa0bAGA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

I had some experience about this. We transform our game from Chinese to Thai
languages. We use GNU's gettext package.

first, all text are around with _"d= e%=o< d8g "(Chinese), but sometimes
we use _ in Lua as a annoy variable, so we changed it to L, and use xgettext
to extra these marker (L"Hello") to a po file, and use GNU GUI tools to
translate the po file.

after that, we compile .po file to .mo file, and use lbuffer
(https://github.com/starwing/lbuffer) transform mo file to Lua table, and
implement the L global function to find text in table.

lbuffer has a table based pack/unpack routines, in days we don't have
string.pack/unpack, nowadays you can use these directly to translate mo to
Lua table.

2016-02-24 0:15 GMT+08:00 Scott Morgan <blumf@blueyonder.co.uk>:
> I'm in the middle of a project where my scripts might have to return 
> localised texts. Nothing too fancy just plain strings (i.e. no 
> formatting of results, time/date formats, etc.)
>
> I think Lua's tables will be good enough to handle holding the data 
> but was wondering if anybody had any experience or insights into 
> organising the data.
>
> Stuff like:
>  * One big file with all translation, or separate files per
language/region?
>  * Pull in via require, or some hand rolled loader?
>  * Use raw tables, meta-table object, or a function call to access the
text?
>  * ID the texts via a native language value, or some unique ID number?
>  * Finding all locations of translated texts in code base to send off 
> for translation
>
> Scott
>



--
regards,
Xavier Wang.



------------------------------

_______________________________________________
lua-l mailing list
lua-l@lists.lua.org
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/lua-l-lists.lua.or
g


End of lua-l Digest, Vol 67, Issue 39
*************************************