[docs] [Bug 407127] New: po2xml produces broken XML in case: <para> text <itemizedlist/> text <xref/> </para>
Eric Bischoff
bugzilla_noreply at kde.org
Wed May 1 15:38:28 BST 2019
https://bugs.kde.org/show_bug.cgi?id=407127
Bug ID: 407127
Summary: po2xml produces broken XML in case: <para> text
<itemizedlist/> text <xref/> </para>
Product: docs
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: ksgmltools
Assignee: kde-doc-english at kde.org
Reporter: bischoff at kde.org
Target Milestone: ---
Created attachment 119767
--> https://bugs.kde.org/attachment.cgi?id=119767&action=edit
Partially working patch
SUMMARY
STEPS TO REPRODUCE
1. Add the following text to some Docbook file
<para>
This is an nice list:<itemizedlist>
<listitem><para>One</para></listitem>
<listitem><para>Two</para></listitem>
<listitem><para>Three</para></listitem>
</itemizedlist>that ends up here: <xref linkend="somewhere"/></para>
2. Extract the messages with xml2pot
3. Translate English into your language, result is in some po file
4. Regenerate the XML file with po2xml
OBSERVED RESULT
Invalid XML file, with the end remaining in English.
EXPECTED RESULT
Properly translated XML file.
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 19.04 disco dingo
Qt: 5.12.2
KDE Frameworks: 5.56.0
kf5-config: 1.0
ADDITIONAL INFORMATION
The problem lies in poxml's parser.cpp lines 507 and 598. With that XML text,
start_line and end_line are identical for variables msg1 and msg2. The blocks:
"This is a nice list:"
and
"<listitem><para>One</para></listitem>
<listitem><para>Two</para></listitem>
<listitem><para>Three</para></listitem>
</itemizedlist>that ends up here: <xref linkend="somewhere"/>"
(variables msg1 and msg2) are at the same level inside the containing <para>,
it seems that this case has been overlooked.
I have a solution, but it only works if the limit between msg1 and msg2 is on
the first line (see attachement). The problem I am unable to resolve is how to
compute the column and line of the limit between msg1 and msg2 (i.e. strindex
characters after the beginning of msg1).
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the kde-doc-english
mailing list