lua-users home
lua-l archive

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


On 29/10/2014 8.06, - wrote:
It will make possible to translate error messages to other languages in a simple way (by replacing that file).

For example.
File lmsg.h


// from lapi.c
#define MSG_UNACCEPTABLE_INDEX    "unacceptable index"
#define MSG_INVALID_INDEX                      "invalid index"
#define MSG_UPVALUE_TOO_LARGE      "upvalue index too large"

Alternatively, it could be useful to keep error messages in a table, so that their language could be switched at runtime (and/or interesting things could be done with a metatable). Only their indices would have to be #defined. (unfortunately this would cost memory and would probably not be a good idea for resource-constrained devices)

--
  Enrico