This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix exgettext to handle multi-line help texts from *.opt files (PR translation/78745)
- From: Thomas Schwinge <thomas at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Mon, 9 Jan 2017 17:21:41 +0100
- Subject: Re: [PATCH] Fix exgettext to handle multi-line help texts from *.opt files (PR translation/78745)
- Authentication-results: sourceware.org; auth=none
- References: <20161229151501.GO21933@tucnak>
Hi!
On Thu, 29 Dec 2016 16:15:01 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> PR translation/78745
> * exgettext: Handle multi-line help texts in *.opt files.
With this committed in r243981, I noticed the following new snippet in
gcc/po/gcc.pot:
+#: config/nvptx/nvptx.c:1132
+msgid "tid.y;"
+msgstr ""
gcc/config/nvptx/nvptx.c:
1126 #define ENTRY_TEMPLATE(PS, PS_BYTES, MAD_PS_32) "\
1127 (.param.u" PS " %arg, .param.u" PS " %stack, .param.u" PS " %sz)\n\
1128 {\n\
1129 .reg.u32 %r<3>;\n\
1130 .reg.u" PS " %R<4>;\n\
1131 mov.u32 %r0, %tid.y;\n\
1132 mov.u32 %r1, %ntid.y;\n\
1133 mov.u32 %r2, %ctaid.x;\n\
[...]
As I understand it, this is because of the special handling to collect
"all %e and %n strings from driver specs, so those can be translated too"
(function spec_error_string). Probably harmless enough to just ignore
it?
Grüße
Thomas
> --- gcc/po/exgettext.jj 2016-01-04 14:55:54.000000000 +0100
> +++ gcc/po/exgettext 2016-12-28 19:18:08.142715830 +0100
> @@ -237,6 +237,8 @@ echo "scanning option files..." >&2
> field = 0
> while (getline < file) {
> if (/^[ \t]*(;|$)/ || !/^[^ \t]/) {
> + if (field > 2)
> + printf("_(\"%s\")\n", line)
> field = 0
> } else {
> if ((field == 1) && /MissingArgError/) {
> @@ -275,12 +277,15 @@ echo "scanning option files..." >&2
> if (field == 2) {
> line = $0
> printf("#line %d \"%s\"\n", lineno, file)
> - printf("_(\"%s\")\n", line)
> + } else if (field > 2) {
> + line = line " " $0
> }
> field++;
> }
> lineno++;
> }
> + if (field > 2)
> + printf("_(\"%s\")\n", line)
> }') >> $emsg
>
> # Run the xgettext commands, with temporary added as a file to scan.
>
> Jakub