Bug 490802

Summary: Lokalize adds newlines to source and target language translations when reading from PO files
Product: [Applications] lokalize Reporter: Finley Watson <fin-w>
Component: generalAssignee: Simon Depiets <sdepiets>
Status: ASSIGNED ---    
Severity: normal CC: aacid, shafff
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: PO file with long strings

Description Finley Watson 2024-07-25 04:02:23 UTC
Created attachment 171971 [details]
PO file with long strings

SUMMARY
PO files can have their source and target strings split over multiple lines (if the string is long, for instance). Lokalize reads them as having newlines added to the strings themselves, rather than processing the PO files and stripping out those newlines

STEPS TO REPRODUCE
1. Open a simple PO file with a long untranslated source string
2. Make a change that counts as a translation of any string
3. Save the file
4. Close Lokalize
5. Reopen Lokalize and the file

OBSERVED RESULT
Both source and target strings that are long have been modified by Lokalize when saving the file, correctly formatting them for PO strings over multiple lines. But the data is not parsed properly when reading the data back, and displays with the newlines still in the strings.

EXPECTED RESULT
Correctly parse strings.

SOFTWARE/OS VERSIONS
Lokalize version: git main

Included is a simple PO file you can test with.
Comment 1 Bug Janitor Service 2024-07-25 16:33:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/138