Fix situations like "</itemizedlist>Some text"
ClosedPublic

Authored by bischoff on Apr 14 2019, 9:19 PM.

Details

Summary

With XML files containing e.g.

<para><itemizedlist>
  (...)
</itemizedlist>Some text</para>

one character is eaten: variable start_col starts at "ome text", and the translation match is not done by po2xml (can't find ... in ... message is displayed).

Diff Detail

Repository
R458 PoXML
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bischoff requested review of this revision.Apr 14 2019, 9:19 PM
bischoff created this revision.
aacid added a comment.Apr 15 2019, 8:40 PM

Do you think you could include this in the tests/lauri.xml and lauri.po?

Hello Albert,

Do you think you could include this in the tests/lauri.xml and lauri.po?

Yes, that should be possible. I'll do it asap.

I also have another fix for another situation that currently produces broken XML:

<para>Some text 1<itemizedlist>
     ...
</itemizedlist>Some text 2</para>

My fix works, but only if the <itemizedlist> starts on same line as Some text 1. I would need the help of a developer who knows better parser.cpp code than me in order to create a better fix.

Would you accept to discuss it by email, or would you know someone who could help?

bischoff updated this revision to Diff 56557.Apr 18 2019, 7:42 PM

added lauri.po and lauri.xml with example

Without the - 1, you get the bug:

$ make

      (...)

[100%] Generating lauri_de.xml
can't find
Extra text we want intact
in
xtra text we want intact </para>
bischoff updated this revision to Diff 56580.Apr 19 2019, 8:01 AM

Used Lokalize for the translation

bischoff updated this revision to Diff 56581.Apr 19 2019, 8:14 AM

Removed German text from lauri.xml

IMHO good for merging.

Although beware I'm not German, so the German texts might not be perfect.

bischoff edited the summary of this revision. (Show Details)Apr 19 2019, 8:27 AM
bischoff updated this revision to Diff 56589.Apr 19 2019, 12:18 PM
bischoff edited the summary of this revision. (Show Details)

Fixed translation team name

aacid added a comment.Apr 20 2019, 9:45 PM

Ok, we should go with this, at least now we have a case that proves it's needed. if it breaks something else people will have to fix that while keeping this not broken :)

Will you commit it or want me to?

Also the xml2pot we use for kde sources in scripty comes from ubuntu so this will take a while to trickle down to there, is this something you need for our sources or for some "external use"?

About the other question i don't think there's anyone at this point that actually knows/remembers how parser.cpp works. But if you want i can try reading your emails and give you insight, but don't really expect much

My big suggestion is use testscases.

Ok, we should go with this, at least now we have a case that proves it's needed. if it breaks something else people will have to fix that while keeping this not broken :)

Yes, the addition to lauri.xml proves it's needed.

I don't think it breaks anything, I already used it on massive amount of XML data.

Will you commit it or want me to?

Please do, I have no idea how to commit it. Maybe next time, you'll explain me how to proceed.

Also the xml2pot we use for kde sources in scripty comes from ubuntu so this will take a while to trickle down to there, is this something you need for our sources or for some "external use"?

I think KDE documentation avoids this case - either pure chance, or people noticed something was wrong and avoided triggering the problem.

I don't need you to fix it for my "external use" - I already use the fixed version (I forked on github). I just wanted to contribute my fix back upstream (= to KDE project).

About the other question i don't think there's anyone at this point that actually knows/remembers how parser.cpp works. But if you want i can try reading your emails and give you insight, but don't really expect much

I could try to speak to Coolo. I think the code is from him. But maybe he does not event remember.

My big suggestion is use testscases.

I'll provide you one for the remaining problem, that's easy to reproduce.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2019, 11:00 PM
Closed by commit R458:3085fdd98daf: Fix situations like "</itemizedlist>Some text" (authored by Eric Bischoff <eric@bischoff@kde.org>, committed by aacid). · Explain Why
This revision was automatically updated to reflect the committed changes.