Messages in this thread | | | Date | Wed, 9 Dec 1998 12:33:12 +0000 (GMT) | From | Riley Williams <> | Subject | Re: Internationalizing Linux |
| |
Hi Tim.
> 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>
In some cases, an argument may need to be used more than once, but that's not a problem with the method I proposed, and am working on implementing.
> 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.
Neither would I be, nor is it necessarily guaranteed to work - some implementations of C treat %Ns (substitute any non-negative integer for N) as specifying the MINIMUM field width for the string. To deal with those, you'd have to use %0.0s instead of %0s at the relevant point.
Best wishes from Riley.
- 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/
| |