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

    > 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.

    This is probably the simplest approach...it does make every occurrence of
    printk() a little ugly, however ;-). A similar alternative (that I
    presented at first) is to do the same thing, but define symbolic names for
    the strings in a separate file (one in each directory, for example):

    #define STRING_FLOPPY_SCREWED "Your floppy is screwed!"
    etc...

    And use "printk(KERN_DEBUG STRING_FLOPPY_SCREWED);" instead. It would be
    easier to consolidate per-language stuff here, rather than going through
    every file and fiddling with the whoel #ifdef logic. Just $0.02.

    Adam
    --
    He feeds on ashes; a deluded mind has led him Adam Bradley, UNCA Senior
    astray, and he cannot deliver himself or say, Computer Science
    "Is there not a lie in my right hand?" Isaiah 44:20
    bradley@cs.unca.edu http://www.cs.unca.edu/~bradley <><


    \
     
     \ /
      Last update: 2005-03-22 13:38    [W:0.019 / U:30.244 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site