lkml.org 
[lkml]   [1997]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Jive -> Kernel (International Linux)
Date
From
> 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.

Because then every time an additional language is added, -every- printk
must be hunted down and modified.

I think the best solution would be to do something like so:

Have one file, lang_default.h, that liiks like so:

#define PRINTK_PANIC "Kernel Panic"
#define PRINTK_BAD_IRQ "Invalid IRQ"
#define PRINTK_HOMICIDAL_CPU "I'm sorry Dave, but I can't do that."

and a series of files, like lang_piglatin.h, that looks like so:

#include <lang_default.h>
#undef PRINTK_PANIC
#define PRINTK_PANIC "Ernalkay Anicpay"
#undef PRINTK_HOMICIDAL_CPU "I'mway orrysay Aveday, utbay Iway \
an'tcay oday atthay."

kernel modules would use the symbolic versions of the strings
instead of the original strings, and all is well. A program can strip
out the strings from the kernel sources to initially create
lang_default.h, as well as report the locations in the source where the
strings wrere found (to facilitate conversion).

Then we can get onto more -important- issues of kernel message
internationalization, like if color is spelled with a 'u' or not.

>
> 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 ;-)
> \____________________________________
>
>

--
Buddha Buck bmbuck@acsu.buffalo.edu
"Just as the strength of the Internet is chaos, so the strength of our
liberty depends upon the chaos and cacaphony of the unfettered speech
the First Amendment protects." -- A.L.A. v. U.S. Dept. of Justice


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.072 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site