Messages in this thread |  | | Date | Sat, 18 Jan 1997 00:49:29 +0000 | From | William Sowerbutts <> | Subject | Re: Jive -> Kernel (International Linux) |
| |
At 23:16 17/01/97 +0000, Philip Blundell wrote: >On Thu, 16 Jan 1997, William Sowerbutts wrote: >> Of course, I've no idea how to code this, I'm not a kernel hacker ;) Maybe >> an "enhanced_printk" type function? This would allow existing kernel code >> to function, but new code could supplement the existing code. The >> enhanced_printk function could be implemented merely as a wrapper around >> the existing printk? > >You could do this with modules. Create a global variable >printk_language_hook, which defaults to NULL. Then amend printk() to say: > >asmlinkage int printk(const char *fmt, ...) >{ > [...] > if (printk_language_hook) > fmt = printk_language_hook(fmt); > [...] >} > >Thus, you can load modules that define printk_language_hook to be a >pointer to some function that substitutes the original English text with >something in the chosen language. You'd have to deal with parameters >somehow, I suppose...
Yes, but this would mean overriding EVERY message the kernel was likely to give. I still think it's unreasonable to expect every message to be translated to a target dialect at once. It should be permissable to translate any messages you see fit to translate, and use the English defaults for others. How could we implement this on a per-user basis? Wouldn't that mean passing the kernel messages through a process attached to the relevant tty, in order to distinguish which user we wanted to translate for?
On the parameters side, couldn't we do it like vprintf does for printf? (By this I mean use va_list and friends).
_________________________________________________________________________ William R Sowerbutts (BtG) btg@thepentagon.com Coder / Guru / Nrrrd http://www.users.dircon.co.uk/~guru/ main(){char*s=">#=0> ^#X@#@^7=";int c=0,m;for(;c<15;c++)for (m=-1;m<7;putchar(m++/6&c%3/2?10:s[c]-31&1<<m?42:32));}
|  |