Bug 592823

Summary: <indexterm> should not break a paragraph for translation
Product: Red Hat Enterprise Linux 6 Reporter: Chester Cheng <ccheng>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: high Docs Contact:
Priority: low    
Version: 6.0CC: mospina, publican-list, raphael, rlandman, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: publican-2.1-0.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-10 21:22:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Chester Cheng 2010-05-17 05:34:05 UTC
Description of problem:
publican interprets <indexterm> tags in a wrong way thus splits up a paragraph into 2 or more paragraphs in .po files.

Version-Release number of selected component (if applicable):
publican-1.6.3-0.el5

How reproducible:


Steps to Reproduce:
1.  publican update_pot
2.  publican update_po --lang=<lang>
3.  Check the .po files
  
Actual results:
(From Installation Guide 6.0 FINAL, techref.xml and techref.po.)

#1: To learn more about
#2: <primary>Anaconda</primary>
#3: <application>anaconda</application>, the Red Hat Enterprise Linux installation program, visit the project Web page: <ulink url="http://www.fedoraproject.org/wiki/Anaconda"/>.

Expected results:
(in one string)
    To learn more about
    <indexterm>
      <primary>Anaconda</primary>
    </indexterm>
    <application>anaconda</application>, the Red Hat Enterprise Linux installation program, visit the project Web page:
    <ulink url="http://www.fedoraproject.org/wiki/Anaconda"/>.

Additional info:
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=581773

Comment 1 Raphaël Hertzog 2010-05-17 05:57:34 UTC
I requested that <indexterm> be translatable even outside of translatables tags (see https://bugzilla.redhat.com/show_bug.cgi?id=582255). While implementing my request this change was apparently introduced.

But I agree with you, it should not split a paragraph or any other translatable tag that contains an <indexterm>.

Comment 2 Manuel Ospina 2010-05-19 22:59:44 UTC
As this bug affect the readability and clarity of the strings to be translated, leaving half phrases out of context, I have increase the severity of this bug.

Comment 3 Raphaël Hertzog 2010-05-21 09:12:52 UTC
Created attachment 415618 [details]
Proposed patch

The attached patch adds indexterm to IGNOREBLOCKS so that it doesn't split translatable tags like it does currently.

Comment 4 Raphaël Hertzog 2010-05-21 09:20:29 UTC
Hum somehow this doesn't work as expected. <indexterm> is no longer caught outside of translatable tags with this patch despite the fact that it's still listed in $TRANSTAGS.

Comment 5 Raphaël Hertzog 2010-05-21 13:43:16 UTC
Trying to fix this, I discovered that's because $node->look_up() (from XML::Element) would happily return the element itself. So the following change is also needed:
@@ -335,7 +335,7 @@ sub get_msgs {
             qr/$TRANSTAGS/,
             sub {
                 not defined(
-                    $_[0]->look_up(
+                    $_[0]->parent()->look_up(
                         '_tag',
                         qr/$IGNOREBLOCKS/,
                         sub {

With this, <indexterm> doesn't split the <para> anymore but it still doesn't appear in the translation string of the para, it has its own string. This might be ok but I have not been able to find the proper way to keep it inline. I'm not sure whether the above change has other undesired side-effects.

Comment 6 Jeff Fearn 🐞 2010-05-22 02:11:12 UTC
Hi Raphaël, which tree are you creating your patch against? There is already a patch for this checked in on the 1.6 branch, it's waiting for testing before this bug can be updated.

Comment 7 Jeff Fearn 🐞 2010-05-22 02:25:30 UTC
Gah, I just noticed this is still in new ... more coffee needed :(

Fixed in build 1.6.3-0.f12.t67

Comment 8 Raphaël Hertzog 2010-05-22 06:23:14 UTC
Hi Jeff, my patch was against the 1.6.3 tarball.

So this bug is fixed by r1215 and is in fact the same than https://bugzilla.redhat.com/show_bug.cgi?id=592666 if I understand correctly. You might want to merge both entries then.

Comment 10 Chester Cheng 2010-05-27 06:17:19 UTC
Change Product to RHEL6, since this affects all the documents to be used in RHEL6.

Comment 11 RHEL Program Management 2010-06-07 16:08:25 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 12 Ruediger Landmann 2010-07-05 04:01:23 UTC
Confirmed that Publican 1.99.t135 doesn't break the string. 

Given this XML:

<para>
This is a test <indexterm><primary>paragraph</primary></indexterm> paragraph in a section
</para>

the resulting PO file entry is:

#. Tag: para
#, no-c-format
msgid "This is a test <indexterm><primary>paragraph</primary></indexterm> paragraph in a section"
msgstr ""


Chester, could you please confirm that this is suitable?

Comment 13 Chester Cheng 2010-07-05 04:04:14 UTC
Hi Rudi,

Yes, it is suitable.

Cheers,
Chester

(In reply to comment #12)
> Confirmed that Publican 1.99.t135 doesn't break the string. 
> 
> Given this XML:
> 
> <para>
> This is a test <indexterm><primary>paragraph</primary></indexterm> paragraph in
> a section
> </para>
> 
> the resulting PO file entry is:
> 
> #. Tag: para
> #, no-c-format
> msgid "This is a test <indexterm><primary>paragraph</primary></indexterm>
> paragraph in a section"
> msgstr ""
> 
> 
> Chester, could you please confirm that this is suitable?

Comment 14 Fedora Update System 2010-07-07 17:35:15 UTC
publican-2.1-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2010-07-07 17:39:49 UTC
publican-2.1-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Andrew Ross 2010-08-08 23:08:21 UTC
Verified: publican-2.1-0.el6.x86_64

Build doc using publican, added xml from comment#12 , po updated as per Chester's orig description.

Output as described / approved in comment#13

#. Tag: para
#, no-c-format
msgid "This is a test <indexterm><primary>paragraph</primary></indexterm> paragraph in a section"
msgstr ""

Comment 21 releng-rhel@redhat.com 2010-11-10 21:22:22 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.