Messages in this thread |  | | Date | Fri, 17 Jan 1997 23:16:43 +0000 (GMT) | From | Philip Blundell <> | Subject | Re: Jive -> Kernel (International Linux) |
| |
On Thu, 16 Jan 1997, William Sowerbutts wrote:
> So, forget that. I propose the following solution: The kernel contains all > of the messages in English. If the user wants to, they may override some of > the messages with their own langauge; if a message isn't overridden the > English default is used. Perhaps the memory used up for the English default > could be freed in some way? > > 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...
P.
|  |