Bug 592823 - <indexterm> should not break a paragraph for translation
<indexterm> should not break a paragraph for translation
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: publican (Show other bugs)
6.0
All Linux
low Severity high
: rc
: ---
Assigned To: Jeff Fearn
ecs-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-17 01:34 EDT by Chester Cheng
Modified: 2016-06-23 00:45 EDT (History)
5 users (show)

See Also:
Fixed In Version: publican-2.1-0.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-10 16:22:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (1.19 KB, patch)
2010-05-21 05:12 EDT, Raphaël Hertzog
no flags Details | Diff

  None (edit)
Description Chester Cheng 2010-05-17 01:34:05 EDT
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 01:57:34 EDT
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 18:59:44 EDT
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 05:12:52 EDT
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 05:20:29 EDT
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 09:43:16 EDT
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-21 22:11:12 EDT
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-21 22:25:30 EDT
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 02:23:14 EDT
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 02:17:19 EDT
Change Product to RHEL6, since this affects all the documents to be used in RHEL6.
Comment 11 RHEL Product and Program Management 2010-06-07 12:08:25 EDT
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 00:01:23 EDT
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 00:04:14 EDT
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 13:35:15 EDT
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 13:39:49 EDT
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 19:08:21 EDT
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 16:22:22 EST
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.

Note You need to log in before you can comment on or make changes to this bug.