Re: Internationalizing Linux

Tim Smith (tzs@tzs.net)
Mon, 7 Dec 1998 17:01:22 -0800 (PST)


One thing to note when internationalizing things is that the *order* of
arguments sometimes needs to be changed. Something in one language that
might be written as

Could not do task <X> because of condition <Y>

might, under different grammatical rules of another language, have to be
written as

A condition <Y> prevented doing task <X>

A truly horrible kludge I've used in that case is to put this in my code:

printf( msg[code], taskname, condname, taskname );

and in English, msg[code] would be

"Could not do task %s because of condition %s\n"

(the extra arg to printf is ignored). If someone needed to translate to
a language that went the other way, they could do this:

"A condition %0s%s prevented doing task %s\n"

If the error message has three parameters, I'd write

printf( msg[code], p1, p2, p3, p2, p1, p2, p3 );

and so on. I'm definitely not proud of this gross hack.

--Tim Smith

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/