linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert White" <rwhite@casabyte.com>
To: "Riley Williams" <Riley@Williams.Name>,
	"Linux Kernel List" <Linux-Kernel@vger.kernel.org>
Subject: RE: kernel support for non-English user messages
Date: Mon, 14 Apr 2003 20:44:29 -0700	[thread overview]
Message-ID: <PEEPIDHAKMCGHDBJLHKGKEIFCHAA.rwhite@casabyte.com> (raw)
In-Reply-To: <BKEGKPICNAKILKJKMHCAGEEBCGAA.Riley@Williams.Name>

Message codes would be *VERY BAD* anyway.  As soon as you start that, then
you need a numbering authority and all that nonsense.

However, it should be "reasonably easy" to preprocess (in the gcc -E sense)
all the files in a kernel directory and the gather up nearly all the
prototype strings.  (you would still have the occasional person who wrote
"char Message[] = "INode: %d invalid"; printk(Message,number);" instead of
having the string in place as just "printk("INode: %d invalid",number);" and
the later is easier to collect up 8-)

The thing is "INode: %d invalid", as a string is easy to decompose into a
regular expression because it is mostly-constant and the non-constant parts
are represented with constant markers.  There are a small number of
degenerate cases [e.g. printk("Filename %s invalid: %s","Filename","invalid:
whitespace character")] that might need to be tweaked but nothing is
perfect.

So "the magic tool" collects these imprint strings and builds a list of all
the strings (for the translator), a recognizer-table (perhaps hashes against
the constant leader word of each message and a regex for the message) that
points to the also-built hash/key into the table of all of the known
strings.

The human translator comes along to prepare the table for the target
language, and populates a replacement-string table with the translations
with suitable $1, $2, etc. style markers for all the messages he can
translate.

At runtime, the translator takes the recognizer-table and does the hash on
the leader word, then tries the string against the regexes with the same
leader hash.  Every match (there should usually be only one) will net the
key hash which in turn leads to the human-supplied replacement line.  $1
style replacement takes place, and the line is emitted in the "new"
language.  IF there is no match, the unchanged line is produced.

It's cute in that in-elegant sort of way, but it *IS* deterministic and
extensible (if the unique hash/key algo can be worked out.)

In fact, such a system could be pointed at, say, the kernel archive, and
produce a translation of all the kernel messages (for a given kernel etc)
and leave the bulk of the message text untouched.

Rob.

-----Original Message-----
From: Riley Williams [mailto:Riley@Williams.Name]
Sent: Friday, April 11, 2003 3:53 PM
To: Robert White; Linux Kernel List
Subject: RE: kernel support for non-English user messages


Hi Robert.

 > Actually, my final point had been that doing it inside the kernel
 > itself, or indeed inside klogd, was probably a very bad idea. If
 > the translation always happens after-the-fact based on properly
 > harvested message semantics then any segment of messages
 > distributed into this mailing list (among other uses) would be
 >
 > A)  Still in English.
 > B)  Translatable after the fact there too.
 >
 > Also after-the-fact translation makes the language translations a
 > scalar problem instead of a matrix one. That is, if you always
 > pass the message stream around in English (treat it like n opaque
 > source file) and then translate it as necessary, it will "always
 > work".
 >
 > If you try to do the translations at message generation time, then
 > the translation must be any-language-to-any-language capable during
 > post-even discussions. Not good.

I can see the points you're making, and that is precisely why I believe
that message codes would be required to implement this idea. As Linus
has vetoed the idea of having message codes in the kernel, I can't see
it ever coming to fruition.

 > Also, you will always have leakage as people add new strings to the
 > set.

That's the easiest aspect of dealing with it - the tool that generates
the language set to use just grabs the "English" language version for
any message codes not in the selected translation.

 > As for the #define issues, when you process the source tree to build the
 > source matrix you just "gcc -E file.c | collector" and now the printk
 > case you mention is handled. Any module designer who does uglier things
 > can make a dead-code procedure that expresses his possible output strings
 > for collection (if he cares.)

 > {Satire}

 > Speaking as an arrogant (U.S. of) American who knows that God(TradeMark,
 > all rights reserved) decreed that he never had to learn any language but
 > his own, I can honestly state, that it is nearly certain that you will
 > get no real support for the multi-language kernel out of a us
USAmericans.
 > We can't even get ourselves to write decent comments, and on the average,
 > we all secretly believe that if we just speak slowly enough everybody
 > really knows English. After all, that's how our condescending "wouldn't
 > want to fail Johnny, it would be bad for his self-image" public schools
 > taught us in the first place.... 8-)

Speaking as an amused (U.S. of) American, I long ago learned how to tell
when
somebody is speaking "God's Language"(tm) - that's simple to work out. After
all, the most likely people to speak "God's Language"(tm) are those that
have
just left His presence - the new born babies - so if we want to listen to
His
language, we just listen to them speak it. What could be simpler???

However, I understand "God's Language"(tm) is not currently understood well
enough by the kernel developers for any of them to translate the kernel
messages into it...

 > {/Satire}

Best wishes from Riley.
---
 * Nothing as pretty as a smile, nothing as ugly as a frown.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10-Apr-2003


  reply	other threads:[~2003-04-15  3:32 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-10 19:21 kernel support for non-english user messages Perez-Gonzalez, Inaky
2003-04-10 20:41 ` Robert White
2003-04-11  9:21   ` kernel support for non-English " Riley Williams
2003-04-11 20:49     ` Robert White
2003-04-11 22:53       ` Riley Williams
2003-04-15  3:44         ` Robert White [this message]
2003-04-15 11:08           ` Alan Cox
2003-04-15 11:08           ` Alan Cox
2003-04-15 14:07           ` Timothy Miller
2003-04-11 21:04     ` Ruth Ivimey-Cook
2003-04-11 21:31       ` Daniel Stekloff
  -- strict thread matches above, loose matches on Subject: below --
2003-04-14 21:27 Chuck Ebbert
2003-04-12 20:31 Chuck Ebbert
2003-04-14  9:07 ` Denis Vlasenko
2003-04-12 16:47 Chuck Ebbert
2003-04-12 15:20 Chuck Ebbert
2003-04-12 15:34 ` Alan Cox
2003-04-12 17:22   ` Robert P. J. Day
2003-04-13  3:59     ` Martin J. Bligh
2003-04-13  6:21   ` John Bradford
2003-04-12  9:52 Chuck Ebbert
2003-04-11 23:38 Chuck Ebbert
2003-04-11 23:36 Jim Keniston[UNIX]
2003-04-11 22:21 Chuck Ebbert
2003-04-11 22:53 ` Martin J. Bligh
2003-04-12  7:55   ` John Bradford
2003-04-12  7:48 ` John Bradford
2003-04-14 11:40 ` Denis Vlasenko
2003-04-14 12:55   ` John Bradford
2003-04-14 17:29     ` Linus Torvalds
2003-04-14 18:15       ` John Bradford
2003-04-14 23:04       ` Felipe Alfaro Solana
2003-04-15 13:21       ` Alex Combas
2003-04-15 18:02       ` Eric Altendorf
2003-04-17 13:46         ` Alan Cox
2003-04-17 15:07         ` Randolph Bentson
2003-04-17 18:49           ` Eric Altendorf
2003-04-14 13:18   ` Sean Neakums
2003-04-14 14:23   ` Valdis.Kletnieks
2003-04-16  5:03     ` Denis Vlasenko
     [not found] <A46BBDB345A7D5118EC90002A5072C780BEBA7DD@orsmsx116.jf.inte l.com>
2003-04-11 20:55 ` kernel support for non-english " Ruth Ivimey-Cook
2003-04-11 20:02 Perez-Gonzalez, Inaky
2003-04-11 16:57 kernel support for non-English " Chuck Ebbert
2003-04-11 17:38 ` Richard B. Johnson
2003-04-11 18:10 ` Matti Aarnio
2003-04-11 14:52 Paolo Ciarrocchi
2003-04-11 13:17 Chuck Ebbert
2003-04-11 13:40 ` John Bradford
2003-04-16  1:59   ` Gerrit Huizenga
2003-04-16 14:28     ` Timothy Miller
2003-04-16 14:37       ` Alan Cox
2003-04-16 16:20         ` Timothy Miller
2003-04-16 17:04       ` Bruce Harada
2003-04-16 18:34         ` Timothy Miller
2003-04-16 18:37           ` Bruce Harada
2003-04-11 14:37 ` Richard B. Johnson
2003-04-11 16:00 ` Linus Torvalds
2003-04-12  8:22 ` Kai Henningsen
2003-04-12 11:08   ` John Bradford
     [not found] <20030409051006$1ecf@gated-at.bofh.it>
     [not found] ` <20030409081011$5257@gated-at.bofh.it>
     [not found]   ` <20030409221017$6c98@gated-at.bofh.it>
     [not found]     ` <20030409225009$2558@gated-at.bofh.it>
     [not found]       ` <20030410014009$78fb@gated-at.bofh.it>
     [not found]         ` <20030410200019$3e8f@gated-at.bofh.it>
     [not found]           ` <20030410202016$7d48@gated-at.bofh.it>
2003-04-11 11:29             ` kernel support for non-english " Tim Connors
2003-04-11 10:10 Chuck Ebbert
2003-04-10 23:23 Chuck Ebbert
2003-04-10 22:13 Chuck Ebbert
2003-04-10 22:33 ` Stephen Hemminger
2003-04-10 21:20 Perez-Gonzalez, Inaky
2003-04-10 22:06 ` Andreas Dilger
2003-04-11  7:38   ` Ville Herva
2003-04-10 20:54 Chuck Ebbert
2003-04-10 21:08 ` Bernd Petrovitsch
2003-04-10 10:47 Ruth Ivimey-Cook
2003-04-09 23:31 Jim Keniston[UNIX]
2003-04-10 19:01 ` Alan Cox
2003-04-11  9:21   ` kernel support for non-English " Riley Williams
2003-04-11 12:16     ` Alan Cox
2003-04-11 13:39       ` John Bradford
2003-04-11 13:11         ` Alan Cox
2003-04-11 14:48           ` John Bradford
2003-04-09 19:25 kernel support for non-english " Perez-Gonzalez, Inaky
2003-04-09 19:01 Perez-Gonzalez, Inaky
2003-04-09  5:02 Frank Davis
2003-04-09  5:29 ` Oliver Neukum
2003-04-09  5:50   ` Frank Davis
2003-04-09  9:37     ` Bernd Petrovitsch
2003-04-09 11:04   ` Alan Cox
2003-04-09  5:53 ` Andreas Dilger
2003-04-09  8:08 ` Matti Aarnio
2003-04-09  9:33   ` Oliver Neukum
2003-04-09 10:24     ` Matti Aarnio
2003-04-09 22:07   ` Werner Almesberger
2003-04-09 22:41     ` Frank Davis
2003-04-09 22:55       ` Ulrich Drepper
2003-04-09 23:53         ` Johannes Ruscheinski
2003-04-10  1:43       ` Richard B. Johnson
2003-04-10 18:57         ` Alan Cox
2003-04-10 20:13           ` Trond Myklebust
2003-04-10 19:42             ` Alan Cox
2003-04-11  0:48               ` Christer Weinigel
2003-04-11 15:56                 ` Daniel Stekloff
2003-04-10 20:53             ` Richard B. Johnson
2003-04-10 23:05               ` Jon Portnoy
2003-04-11  5:39                 ` DevilKin
2003-04-11  5:49                   ` Arnaldo Carvalho de Melo
2003-04-11  6:17                     ` DevilKin
2003-04-11 17:51                     ` Randy.Dunlap
2003-04-11 11:57               ` Helge Hafting
2003-04-11 17:55                 ` David Lang
2003-04-10 20:36           ` John Bradford
2003-04-10 22:20             ` Shaya Potter
2003-04-11  4:19               ` Valdis.Kletnieks
2003-04-11  4:23                 ` Shaya Potter
2003-04-11  8:40                   ` Henning P. Schmiedehausen
2003-04-11  9:09                 ` John Bradford
2003-04-11 10:59                   ` Valdis.Kletnieks
2003-04-11 11:11                     ` John Bradford
2003-04-11 11:40                 ` Helge Hafting
2003-04-10  8:19       ` Oliver Neukum
2003-04-09 13:11 ` Giuliano Pochini
2003-04-10  3:08 ` Linus Torvalds
2003-04-10  9:05   ` kernel support for non-English " Riley Williams
2003-04-10 17:35     ` Linus Torvalds
2003-04-10 18:32       ` John Bradford
2003-04-12  2:55       ` Chris Wedgwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PEEPIDHAKMCGHDBJLHKGKEIFCHAA.rwhite@casabyte.com \
    --to=rwhite@casabyte.com \
    --cc=Linux-Kernel@vger.kernel.org \
    --cc=Riley@Williams.Name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).