This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix exgettext to handle multi-line help texts from *.opt files (PR translation/78745)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]