bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #42206] xgettext concatenates lines in C files when it shouldn't


From: Bruno Haible
Subject: [bug #42206] xgettext concatenates lines in C files when it shouldn't
Date: Wed, 15 Mar 2023 18:47:20 -0400 (EDT)

Follow-up Comment #6, bug #42206 (project gettext):

If we would want to treat #if lines correctly, we would need to
1) handle the #else case as an alternative,
2) handles contexts correctly,
3) handle different #ifs in different ngettext arguments correctly.

To illustrate the complexity of 1) and 2): The attached init2.c, when
processed through
$ xgettext -o - --no-location --omit-header -kmessage:2 -kcmessage:1c,2
init2.c
would need to produce


msgid "The system is halted. You may reboot now."
msgstr ""

msgid "The system is halted. Press Reset or turn off power"
msgstr ""

msgctxt "log"
msgid "You may reboot now."
msgstr ""

msgctxt "log"
msgid "Press Reset or turn off power"
msgstr ""


Currently, with Daiki's patch, it produces


msgid "The system is halted. You may reboot now."
msgstr ""

msgctxt "log"
msgid "You may reboot now."
msgstr ""


In the implementation (x-c.c), this would imply to keep track of several
alternative argparsers, where the code currently uses a single argparser.

This is quite complex.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?42206>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]