texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp/Texinfo/Convert Plaintext.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo/Convert Plaintext.pm
Date: Tue, 31 May 2011 22:59:31 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/05/31 22:59:31

Modified files:
        tp/Texinfo/Convert: Plaintext.pm 

Log message:
        Translate section title string.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.138&r2=1.139

Patches:
Index: Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -b -r1.138 -r1.139
--- Plaintext.pm        1 May 2011 19:10:04 -0000       1.138
+++ Plaintext.pm        31 May 2011 22:59:30 -0000      1.139
@@ -838,12 +838,31 @@
  SECTION:
     while ($section) {# and $section ne $section_root) {
       push @{$self->{'count_context'}}, {'lines' => 0, 'bytes' => 0};
-      my $section_title = $self->convert_line({'contents'
-                => $section->{'extra'}->{'misc_content'},
+      my $section_title_tree;
+      if (defined($section->{'number'}) 
+          and ($self->get_conf('NUMBER_SECTIONS')
+               or !defined($self->get_conf('NUMBER_SECTIONS')))) {
+        if ($section->{'cmdname'} eq 'appendix' and $section->{'level'} == 1) {
+          $section_title_tree = $self->gdt('Appendix {number} {section_title}',
+                           {'number' => {'text' => $section->{'number'}},
+                            'section_title' 
+                              => {'contents' => 
$section->{'extra'}->{'misc_content'}}});
+        } else {
+          $section_title_tree = $self->gdt('{number} {section_title}',
+                           {'number' => {'text' => $section->{'number'}},
+                            'section_title' 
+                              => {'contents' => 
$section->{'extra'}->{'misc_content'}}});
+        }
+      } else {
+        $section_title_tree = {'contents' => 
$section->{'extra'}->{'misc_content'}};
+      }
+      my $section_title = $self->convert_line(
+            {'contents' => [$section_title_tree],
                'type' => 'frenchspacing'});
       pop @{$self->{'count_context'}};
-      my $text = Texinfo::Convert::Text::numbered_heading($section, 
-                     $section_title, $self->get_conf('NUMBER_SECTIONS'))."\n";
+      my $text = $section_title;
+      chomp ($text);
+      $text .= "\n";
       $result .= (' ' x (2*($section->{'level'} - ($root_level+1)))) . $text;
       $lines_count++;
       if ($section->{'section_childs'} 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]