Messages in this thread |  | | Date | Sat, 18 Jan 1997 13:11:36 +0000 (GMT) | From | Bryn Paul Arnold Jones <> | Subject | Re: Jive -> Kernel (International Linux) |
| |
On Fri, 17 Jan 1997, Adam D. Bradley wrote:
> > Ack! Worst problem: > (1) Strings have to be _recognized_ and then substituted. Have to do a > bunch of strstr()'s over a massive string table. Alternately, you could > do a hash on the fmt pointer to speed up the search, but still. And this > invokes this same overhead on _any_ printk message once the language > module is loaded; there's no allowance for "quick+dirty" dumps, eg OOPS > data which we don't have/want to think about translating/formatting. > > Adam > --
We've had modules, user processes, kernel loading predetermined files with the relivent strings, ....
Why not just make it simple, and have a config option that appends a '-D<lang>' to the cflags, and then have the printk's like this:
printk(KERN_DEBUG, #ifdef LANG1 "Message that %s said %d in lang 1\n" #else /* not in LANG1 */ #ifdef LANG2 "Message that %s said %d in lang 2\n" else /* not in LANG2 */ "Message that %s said %d in english\n" #endif /* LANG2 */ #endif /* LANG1 */ , device->name, status);
That way if the printk hasn't been translated to the perticular language yet, the english is used, it dosn't use memory for each additional language, and you also don't have all that messing with loading, and searching through, lists of translations.
Bryn -- PGP key pass phrase forgotten, \ Overload -- core meltdown sequence again :( and I don't care ;) | initiated. / This space is intentionally left | blank, apart from this text ;-) \____________________________________
|  |