Menu

#1305 .PO filter bug: display issue when a msgctxt spans several lines

6.1
open-fixed
5
2025-09-10
2025-08-20
No

Hello;
It would seem that the “Comments” panel in OmegaT cannot display the content of a .PO file’s msgctxt elements if it contains several lines.
Is there a way to change this, please?

Steps to reproduce:
1. Have a .PO file with msgctxt elements containing several lines (for instance, generated with the csv2po utility).
2. Import said .PO file as source into OmegaT using the default .PO filter.
3. Check out the Comments panel.

Expectation:
The entire content of each msgctxt element would be visible in the “Path:” part of “Comments” panel when navigating to the corresponding segment.

What happened:
The content of a given msgctxt element only appears if it is contained in a single line (even if the line itself is so long that it wraps around in a text editor).
If the content contains linebreaks, it won’t display in the Comments panel.

For instance:
OmegaT will only display the first line of content in msgctxt for the following translation unit:

msgctxt "Lorem ipsum dolor sit amet, consectetur adipiscing elit,"
"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
"reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur"
"Excepteur sint occaecat cupidatat non proident"
msgid "Placeholder source."
msgstr "Placeholder target"

But the unit below would have its entire context properly displayed:

msgctxt "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident"
msgid "Placeholder source."
msgstr "Placeholder target"

You will find attached a sample .PO file (Example.po) for reference.

Side notes:
For the sake of comparison, I tried opening the same file in KDE’s “Lokalize” tool, and both units displayed the same context information, complete, in a single block. This shows that it is possible, at least, but I do not have the technical knowledge to understand how and why.
Content located in # comments in a .PO file displays properly (in the “References:” part of the “Comemnts” pannel). Only the content of msgctxt seems to be affected.
Though msgctxt content itself isn’t really meant to span several lines, it might be used as such in some workflows.
Thank you in advance for your help!

1 Attachments

Discussion

  • Hiroshi Miura

    Hiroshi Miura - 2025-08-21

    Your example is not consistent for space character between continueous lines.
    see -> https://www.gnu.org/software/gettext/manual/html_node/More-Details.html

    msgctxt "Lorem ipsum dolor sit amet, consectetur adipiscing elit,"
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
    "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur"
    "Excepteur sint occaecat cupidatat non proident"
    

    and

    msgctxt "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident"
    

    are not same.

    The former will be recognized as

    msgctxt "Lorem ipsum dolor sit amet, consectetur adipiscing elit,sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Excepteur sint occaecat cupidatat non proident"
    

    Could you confirm?

     
  • Hiroshi Miura

    Hiroshi Miura - 2025-08-21
    • assigned_to: Hiroshi Miura
     
  • Hiroshi Miura

    Hiroshi Miura - 2025-08-21

    The PR that implement reproducible has been raised;
    https://github.com/omegat-org/omegat/pull/1618

     
    • Hiroshi Miura

      Hiroshi Miura - 2025-08-21

      The fix has also been pushed.
      * produce Path from multiline msgctxt
      * TMX has the escaped lifefeed character in path value
      * Comments pane will show unescaped linefeed Path value

       
      • Ludovic Seigneurin

        Your example is not consistent for space character between continueous lines.

        This was a mistake on my end. I wanted the examples to have the same expected result, and didn't notice the discrepancy. I confirm there would be a slight difference because of it, as you highlighted.

        The fix has also been pushed.

        Thank you for helping so fast! I will get back here when I have time to look into it.

         
  • Hiroshi Miura

    Hiroshi Miura - 2025-08-30

    I will be merged the PR soon. You can check a behavior with the Weekly release.

     
    🎉
    2
    • Ludovic Seigneurin

      Hi; I've just tested it out; I confirm it fixes the issue I was met with. Thank you for your swift action!

       
  • Hiroshi Miura

    Hiroshi Miura - 2025-09-05
    • status: open --> open-fixed
     

Log in to post a comment.