PO files generates without content in the target

Hello everyone,

I've been having some issues with PO files. Our currently PO file type handles PO files without any issue in the sense that we can see and translate content correctly. However, the problem appears when we generate the target files for final delivery to the client. The translated content is not correctly placed between the inverted commas in the PO file. This is what I mean:

Screenshot showing PO file content with translated text placed outside the inverted commas, indicating incorrect formatting.

This prevents the client to correctly use the PO file.

My current PO file type is this one:

Screenshot of Trados Studio file type settings showing the current PO file type version 1.0.0.0.

I have checked another threads and I see one recommendation is to use download the extended PO file setting. I have done so:

Screenshot of Trados Studio file type settings showing the downloaded extended PO file type version 1.5.0.

However, this file setting does not work with my file. I get the following error then trying to use the preview function:

Warning message in Trados Studio stating 'Cannot find file type settings for the preview file.'

And the following error when I try to create the project.

Error messages in Trados Studio indicating pre-scanning failed to identify the file type and unexpected line patterns in the PO file.

Which is weird, since the v 1.0.0.0 handles the file just fine.

Is there any way I can solve the issue of the target placed outside the msgstr markers without having to search and replace the file after translation?

Best regards,

Franco Albrecht.



Generated Image Alt-Text
[edited by: Trados AI at 6:06 PM (GMT 0) on 28 Feb 2024]
emoji
Parents Reply Children
  • Could you please confirm that it is working for you?

    Partially... ;-)

    It now successfully parses the file from this thread and does not freak out anymore... so that's a progress.

    But the multiline "msgctxt" strings are not added to the Document Structure Info - only strings with single-line "msgctxt" have the "Context information" added (these are marked as F+ in the DSI column).
    See the screenshot below.

    Screenshot of Trados Studio showing Document Structure Information column with items marked as F+ indicating single-line 'msgctxt' strings have 'Context information' added, while multiline 'msgctxt' strings are missing this info.

    EDIT:
    Perhaps some addirtional changes in the LineParser.cs are needed... like in the "text" section - something like

                    .After(msgctxt)
                    .CanBeFollowedBySameAs(msgctxt)

    It's really hard to say for someone who is not author of the code, since the philosophy of the code is hard to understand... there are no comments, nothing...

    And BTW, I also noticed another issue - the generated target file does not honor the linebreaks type of the source file.
    For example, this source file has Unix linebreaks (LF), but the target file is generated with DOS/Windows linebreaks (CRLF).

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 6:06 PM (GMT 0) on 28 Feb 2024]
  • Hi Evzen

    thanks for you feedback. 

    Those changes you mention are needed as well but and actually already included in that test version. What's missing is the text collection for a message context entry in the EntryBuilder. I'll add that.

    As for the comments: I agree that some documentation about the architecture and concept should be added to the project/ in the Github repo. That is actually on my todo list.

    the generated target file does not honor the linebreaks type of the source file.

    ok, we can add that.