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

Daniel Resare noa@melody.se
Thu, 27 Jan 2000 12:33:59 +0100


--+xNpyl7Qekk2NvDX
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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.

Werner could you please include it in later versions of
gnupg?

(the patch is against the gnupg-1.0.0h since that is the last
version in the Translation Project system)

cheers/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

--+xNpyl7Qekk2NvDX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=gnupgdiff

--- ../../gnupg-1.0.0h.vanilla/g10/pkclist.c	Sat Dec  4 13:31:09 1999
+++ pkclist.c	Thu Jan 27 12:08:45 2000
@@ -194,7 +194,10 @@
 
     for(;;) {
 	/* a string with valid answers */
+	/* translation is ok, since the english version is hardwired */
+	/* and will always work */
 	const char *ans = _("sSmMqQ");
+	#define EN_ANS "sSmMqQ"
 
 	if( !did_help ) {
 	    if( !mode ) {
@@ -247,16 +250,19 @@
 	    changed = 1;
 	    break;
 	}
-	else if( *p == ans[0] || *p == ans[1] ) {
+	else if( *p == ans[0] || *p == ans[1] ||
+                 *p == EN_ANS[0] || *p == EN_ANS[1] ) {
 	    tty_printf(_(
 		"Certificates leading to an ultimately trusted key:\n"));
 	    show = 1;
 	    break;
 	}
-	else if( mode && (*p == ans[2] || *p == ans[3] || *p == CONTROL_D ) ) {
+	else if( mode && (*p == ans[2] || *p == ans[3] || *p == CONTROL_D ||
+		 *p == EN_ANS[2] || *p == EN_ANS[3] ) ) {
 	    break ; /* back to the menu */
 	}
-	else if( !mode && (*p == ans[4] || *p == ans[5] ) ) {
+	else if( !mode && (*p == ans[4] || *p == ans[5] ||
+		 *p == EN_ANS[4] || *p == EN_ANS[5] ) ) {
 	    quit = 1;
 	    break ; /* back to the menu */
 	}

--+xNpyl7Qekk2NvDX--