| Summary: | Lokalize changes ' to apostrophe character in source strings of TS files | ||
|---|---|---|---|
| Product: | [Applications] lokalize | Reporter: | wojnilowicz <lukasz.wojnilowicz> |
| Component: | editor | Assignee: | Simon Depiets <sdepiets> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | shafff |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/lokalize/9e80b8358e401888f4bf179b1a8bd818624e796b | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: |
Original and Lokalized TS File comparison
sqlb_pl-original.ts sqlb_pl-lokalized.ts |
||
|
Description
wojnilowicz
2020-03-21 12:05:20 UTC
Created attachment 126925 [details]
sqlb_pl-original.ts
Created attachment 126926 [details]
sqlb_pl-lokalized.ts
Please notice that 1st line of sqlb_pl-original.ts <?xml version="1.0" encoding="utf-8"?> got changed to <?xml version='1.0' encoding='utf-8'?> so Lokalize replaced double with single quotation marks as well. That's marked in first attachment as well. We could technically argue that it is still correct as ' is not a reserved character in XML in that specific location (only & and < are), but I won't do that. It's actually the behavior of the Qt xml parser, I found a workaround by using CDATA, I will push it this week-end (and it will be optionnal). Git commit 9e80b8358e401888f4bf179b1a8bd818624e796b by Simon Depiets. Committed on 18/04/2020 at 15:58. Pushed by sdepiets into branch 'master'. TS storage shall not un-escape XML special chars By default the QXmlSimpleReader transforms escaped XML chars into the actual chars (except < and &) Now lokalize will re-escape them back and store them in a CData to prevent Qt from amending the string internally On saving, the XML file is first exported to a string and the CData overhead is replaced. This behavior can be disabled in Editor Settings M +83 -32 src/catalog/ts/tsstorage.cpp M +1 -1 src/catalog/ts/tsstorage.h M +3 -0 src/prefs/lokalize.kcfg M +27 -20 src/prefs/prefs_editor.ui https://commits.kde.org/lokalize/9e80b8358e401888f4bf179b1a8bd818624e796b Thank you for the fix. |