diff options
author | Werner Koch <[email protected]> | 2022-12-16 16:20:17 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2022-12-16 16:20:45 +0000 |
commit | 885a287a57cf060b4c5b441822c09d23b8dee2bd (patch) | |
tree | a591c7ade103a2398c22ee4307eda80fd6f40902 /src/argparse.c | |
parent | Add more tests for t-printf and t-strerror. (diff) | |
download | libgpg-error-885a287a57cf060b4c5b441822c09d23b8dee2bd.tar.gz libgpg-error-885a287a57cf060b4c5b441822c09d23b8dee2bd.zip |
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: [email protected]
PO-Revision-Date: 2022-10-07 09:52+0200
Last-Translator: Werner Koch <[email protected]>
Language-Team: German <[email protected]>
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[...]
Diffstat (limited to 'src/argparse.c')
-rw-r--r-- | src/argparse.c | 9 |
1 files changed, 7 insertions, 2 deletions
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)) |