diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-02-21 22:01:03 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-02-21 22:01:03 +0100 |
commit | 8d1780b56d0cb1d50115d4e925e81cd8b9cb2923 (patch) | |
tree | 487d93ee09d398aa138d6b5f04666899f474f8ca /gcc/opts.c | |
parent | d11676de2961d10c10b82f04da28254cb46ef645 (diff) | |
download | gcc-8d1780b56d0cb1d50115d4e925e81cd8b9cb2923.zip gcc-8d1780b56d0cb1d50115d4e925e81cd8b9cb2923.tar.gz gcc-8d1780b56d0cb1d50115d4e925e81cd8b9cb2923.tar.bz2 |
i18n: Fix translation of --help [PR93759]
The first two hunks make sure we actually translate what has been marked
for translation, i.e. the cl_options[...].help strings, rather than those
strings ammended in various ways, like:
_("%s Same as %s."), help, ...
or
"%s %s", help, _(use_diagnosed_msg)
The exgettext changes attempt to make sure that the cl_options[...].help
strings are marked as no-c-format, because otherwise if they happen
to contain a % character, such as the 90% substring, they will be marked
as c-format, which they aren't.
2020-02-21 Jakub Jelinek <jakub@redhat.com>
PR translation/93759
* opts.c (print_filtered_help): Translate help before appending
messages to it rather than after that.
* exgettext: For *.opt help texts, use __opt_help_text("...")
rather than _("...") in the $emsg file and pass options that
say that this implies no-c-format.
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1309,10 +1309,13 @@ print_filtered_help (unsigned int include_flags, help = undocumented_msg; } + /* Get the translation. */ + help = _(help); + if (option->alias_target < N_OPTS && cl_options [option->alias_target].help) { - if (help == undocumented_msg) + if (option->help == NULL) { /* For undocumented options that are aliases for other options that are documented, point the reader to the other option in @@ -1347,9 +1350,6 @@ print_filtered_help (unsigned int include_flags, help = new_help; } - /* Get the translation. */ - help = _(help); - /* Find the gap between the name of the option and its descriptive text. */ tab = strchr (help, '\t'); |