Re: Kernel-Messages translation

Matthias Urlichs (smurf@work.smurf.noris.de)
15 Jun 1997 12:50:10 +0200


Rogier Wolff <wolff@rosie.et.tudelft.nl> writes:
>
> Wanted: Maintainer.
> Maintainer will correspond with Linus to see wether he might agree to
> put in a few (*) patches to allow the kernel to be multilingual. If this
>
> (*) A macro call around EVERY text string.....
>
I'd use something like

before:
printk(KERN_DEBUG "The foo at %d breaks bar with %s\n",foo,bar)
printk(KERN_DEBUG "The foo at %d breaks baz with %s\n",foo,baz)

after:
printk_FOO_BREAKS_BAR(foo,bar)

and in some file

FOO_BREAKS_BAR KERN_DEBUG "The foo at %d breaks bar with %s\n"
or
FOO_BREAKS_BAZ KERN_DEBUG "Baz with %s gets trashed by foo at %d/2\n",a2,a1*2

(default: use the number of % characters to count arguments, autocreate
a1...a999 macro variables) which gets autotranslated by a small Perl or Awk
script to

#ifndef printk_FOO_BREAKS_BAR
#define printk_FOO_BREAKS_BAR(a1,a2) printk(KERN_DEBUG "The foo at %d breaks bar with %s\n",(a1),(a2))
#endif
#ifndef printk_FOO_BREAKS_BAZ
#define printk_FOO_BREAKS_BAZ(a1,a2) printk(KERN_DEBUG "Baz with %s gets trashed by foo at %d/2\n",(a2),(a1*2))
#endif

The advantage is that you can reorder arguments at will (if required for a
language), there will NOT be any kernel bloat, you can include more than
one language before the English default, and we could even autogenerate a
version which supports a runtime language switch (which is the only reason
this would result in any kernel bloat at all).

An alternate solution would be to use the standard internationalization
tools, but I don't see how kernel bloat could be avoided with these.

I'm not convinced that a user-space tool could work. Too much is printed at
boot time that really should be comprehensible to the non-English speaking
user.

-- 
You can lead a horticulture, but you can't make her think.
                                -- Dorothy Parker
-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP Nürnberg 
Schleiermacherstraße 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 Nürnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42