Hi!

As mentioned in the PR, the option handling for multi-line help texts
concatenates those lines with spaces in between (essentially replaces
newlines with spaces), but exgettext extracts just the first line from the
multiline help text and throws away the rest.

With this patch, there are changes like:
 #: config/i386/i386.opt:583
-msgid "Do dispatch scheduling if processor is bdver1, bdver2, bdver3, bdver4"
+msgid ""
+"Do dispatch scheduling if processor is bdver1, bdver2, bdver3, bdver4 or "
+"znver1 and Haifa scheduling is selected."
 msgstr ""
in gcc.pot.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-12-29  Jakub Jelinek  <ja...@redhat.com>

        PR translation/78745
        * exgettext: Handle multi-line help texts in *.opt files.

--- 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

Reply via email to