From 8d1780b56d0cb1d50115d4e925e81cd8b9cb2923 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 21 Feb 2020 22:01:03 +0100 Subject: 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 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. --- gcc/po/ChangeLog | 7 +++++++ gcc/po/exgettext | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc/po') diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 9e763ea..4fda0a4 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,10 @@ +2020-02-21 Jakub Jelinek + + PR translation/93759 + * 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. + 2020-02-20 Joseph Myers * de.po: Update. diff --git a/gcc/po/exgettext b/gcc/po/exgettext index 7a86ed9..d648bdb 100644 --- a/gcc/po/exgettext +++ b/gcc/po/exgettext @@ -227,6 +227,7 @@ END { } } print emsg > posr + print "--keyword=__opt_help_text\n--flag=__opt_help_text:1:no-c-format" >> kopt }' ) || exit @@ -240,7 +241,7 @@ echo "scanning option files..." >&2 while (getline < file) { if (/^[ \t]*(;|$)/ || !/^[^ \t]/) { if (field > 2) - printf("_(\"%s\")\n", line) + printf("__opt_help_text(\"%s\")\n", line) field = 0 } else { if ((field == 1) && /MissingArgError/) { @@ -287,7 +288,7 @@ echo "scanning option files..." >&2 lineno++; } if (field > 2) - printf("_(\"%s\")\n", line) + printf("__opt_help_text(\"%s\")\n", line) }') >> $emsg # Run the xgettext commands, with temporary added as a file to scan. -- cgit v1.1