lua-users home
lua-l archive

Re: Simplification of localization.

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


Am 29.10.2014 um 07:11 schröbte steve donovan:
On Wed, Oct 29, 2014 at 8:01 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
You mean something like this:
error(msg.x_should_lie_between_0_and_255)
Although I think the OP means in the Lua core, so it's more like
#define x_should_lie_between_0_and_25 "x should lie between 0 and 255"
Tricky to do when there's format specifiers in general.
We probably need a way to specify the order in format specifiers (like in GLIBC) first ...
From `man 3 printf`:
Many countries use the day-month-year order. Hence, an internationalized version must be able to print the arguments in an
 order specified by the format:
 #include <stdio.h>
 fprintf(stdout, format,
 weekday, month, day, hour, min);
 where format depends on locale, and may permute the arguments. With the value:
 "%1$s, %3$d. %2$s, %4$d:%5$.2d\n"
 one might obtain "Sonntag, 3. Juli, 10:02".
Philipp

AltStyle によって変換されたページ (->オリジナル) /