Messages in this thread | | | From | "James Mastros" <> | Subject | Kernel-Messages translation | Date | Sat, 14 Jun 1997 03:41:22 -0400 |
| |
---- From: Keith Rohrer <kwrohrer@uiuc.edu> To: Kurt Huwig <kurt@huwig.de> Cc: amu@mit.edu; linux-kernel@vger.rutgers.edu; pavel@atrey.karlin.mff.cuni.
cz; joepran@telerama.lm.com Date: Thursday, June 12, 1997 7:27 PM Subject: Re: Kernel-Messages translation
>Executive summary: >1) global string tables, loading only one at a time to avoid bloating > the binary (nobody seems to care about kernel source bloat) >2) code which doesn't explicitly do the table lookup will work the > same as always >3) use multiple tables/table sections to minimize message allocation > conflicts > How about this: There are several files, lang.err.msg (one for each language, obviously), each containing somthing like this: english.err.msg: #define ERROR_MSG_READ_ONLY "read-only" #define ERROR_MSG_REMOUNT "Error, remounting " ... Make config copies the approate error defines for your locality, and anything that needs error-messages includes this file. Viola, no slowdown, no new code (not much anyway), and no bloat in the binary. When a developer needs to translate an error message back to their native tounge, they simply need to grep the approtate lang.err.msg file. The only problem I see is that when a developer adds a message, they need to do so in all of the lang.err.msg files. Perhaps we should cat /w english (assume english is the primary lang, sort, and kill dupes with a shell-script during make dep (just including both would give a bunch of double-defining, and it is undifined which would take precidance.) Oh, just thought of some more problems: this makes it harder if the error-reciver reports the message with incorect spelling, and you cannot change languages withought a recompiile (or atleast a reboot). Perhaps the symbols should be char[] in modules and defaults in a init_data'ed section, but I think that then you should write a program to write the module source from a table of messages & symbol names (e.g. error_msg_readonly: "read-only") would create in the module code: const char[] error_msg_readonly = "read-only"; EXPORT(error_msg_readonly) (Not quite shure on that EXPORT, but you get the idea, no?)
-=- James Mastros
| |