PATCH: translation of menu-commands now possible in pkclist.c

Edmund GRIMLEY EVANS edmundo@rano.org
Fri, 28 Jan 2000 15:42:34 +0000


Daniel Resare <noa@melody.se>:


> > An alternative would be to change the notation: use a string like
> > "sS,mM,qQ", which a translater could translate as "xX,yY,zZ", if they
> > don't want the English keys to be accepted, or as "xXsS,yYmM,zZqq", if
> > they do. Either way, the translator can see the consequences of their
> > decision, whereas your patch might have nasty circumstances if someone
> > were translating into a language in which the word for "quit" starts
> > with 's' ... particularly if the word for "show" happens to start with
> > 'q'!
>
> Perhaps the program should check for inconsistencies in the translation
> and warn the user telling him to contact the translators for his language
> to solve this situation.
If not the program, perhaps the build process or "make test" phase.
> > I sent a patch to the list last night in which I suggest a similar
> > solution for the commands in keyedit.c.
>
> i missed that one, to which list wasit?
This one. Obviously it didn't get through. I'll repost it ...
> > I've heard that soon gettext will automatically convert message
> > strings to the charset of the user's current locale. A single
> > non-ASCII character will become several octets when converted into
> > UTF-8 (which will be the most widely used charset soon). So any code
> > that wants to look at the third character of a translated string by
> > just doing ans[2], say, will break horribly.
>
> When that day comes lots of things will break horribly in gnupg. Perhaps
> someone with knowledge of the UNICODE system could review the code
> and write an intelligent replacement to all the character comparison
> cases.
It might not be too hard. UTF-8 is US-ASCII-compatible, provided you don't make assumptions about the length of a string or its width when printed. And you should avoid using "char" as a character. Stuff like printf("%-10s %-10s", x, y) won't make nice screen columns in UTF-8, so you need a function for that. That's the sort of thing I had to change to make mutt work in UFT-8 (www.rano.org/mutt.html). Of course mutt displays gnupg's output when it verifies a signature, etc, so I really ought to patch gnupg just to finish the job properly ... Edmund