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

Daniel Resare noa@melody.se
Fri, 28 Jan 2000 15:11:58 +0100


On tor, jan 27, 2000 at 04:29:25 +0000, Edmund GRIMLEY EVANS wrote:

> Daniel Resare <noa@melody.se>:
>
> > When translating the gnupg messages to swedish i noticed the following
> > entry
> >
> > #. a string with valid answers
> > #: g10/pkclist.c:197
> > msgid "sSmMqQ"
> >
> > and i wondered if it was ok to translate this message, or if the
> > english standard behaviour of the program would break if i did.
> > Checking the source I came to the conclution that my worries were
> > relevant, if the string sSmMqQ is translated to another language
> > not only the translation of the program changes but also the behaviour,
> > which is not desired. So i wrote the following patch to solve the
> > problem.
>
> I'm not sure this is the right way to do it. Hard-wired things are to
> be avoided, I think ...
I agree my solution is not the ideal one, but sometimes Worse Is Better[1] The hardcoded solution i've implemented is modeled from the yesno functions in util/miscutil.c and I think they are an improvment over the current situation where only the user supplied input is checked against the translated string only which leads to a situation where gnupg changes behaviour (not just language output) depending on the current locale.
>
> 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.
>
> 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?
>
> But I suppose we really ought to be thinking about wide characters and
> charset support, too; a Russian user might be using koi8-r or utf-8.
> The same problem effects lots of programs, not just gnupg ...
>
If anyone has a bunch of free time a set of functions handling user input with respect to case conversion in different charsets, unicode and so on would be really nice. /daniel -- Daniel Resare @ Melody Interactive Solutions address: Bredgränd 4, Box 2163, SE-103 14 Stockholm phone: +46 8 454 96 15 cellphone: +46 707 333 914