From 885a287a57cf060b4c5b441822c09d23b8dee2bd Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 16 Dec 2022 17:20:17 +0100 Subject: core: Fix translations of --help * src/argparse.c (show_help): Do not translate the empty string. -- PO files use the empty string for meta information. However, to mark the end of the heder group we also use an empty string and that one gets translated - boom. Example of this error: [...] -u, --local-user USER-ID [...] Project-Id-Version: gnupg-2.3.0 Report-Msgid-Bugs-To: translations@gnupg.org PO-Revision-Date: 2022-10-07 09:52+0200 Last-Translator: Werner Koch Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n != 1; : (Auf der "man"-Seite ist eine volls[...] --- src/argparse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/argparse.c b/src/argparse.c index ef0c161..8651e00 100644 --- a/src/argparse.c +++ b/src/argparse.c @@ -2937,7 +2937,7 @@ cmp_ordtbl (const void *a_v, const void *b_v) * this option * - a description which starts with a '@' and is followed by * any other characters is printed as is; this may be used for examples - * and such. This is a legacy methiod, moder codes uses the flags + * and such. This is a legacy method, modern code uses the flags * ARGPARSE_OPT_VERBATIM or ARGPARSE_OPT_HEADER. * - A description which starts with a '|' outputs the string between this * bar and the next one as arguments of the long option. @@ -3000,7 +3000,12 @@ show_help (opttable_t *opts, unsigned int nopts, unsigned int flags) writestrings (0, "Options:", "\n", NULL); for (i=0; i < nopts; i++ ) { - s = map_fixed_string (_( opts[ordtbl[i]].description )); + /* Do not translate the empty string becuase it is used as + * the identification of the PO file. */ + if (opts[ordtbl[i]].description && *opts[ordtbl[i]].description) + s = map_fixed_string (_( opts[ordtbl[i]].description )); + else + s = ""; if ( s && *s== '@' && !s[1] ) /* Hide this line. */ continue; if ( s && (opts[ordtbl[i]].flags & ARGPARSE_OPT_HEADER)) -- cgit v1.2.3