Your message dated Wed, 20 May 2015 23:19:30 +0000
with message-id <[email protected]>
and subject line Bug#748601: fixed in po4a 0.46-1
has caused the Debian Bug report #748601,
regarding po4a: Man module splits tbl's textblocks into separate lines
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
748601: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748601
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: po4a
Version: 0.45-1
Severity: normal
Tags: patch

Hi,

The man module does not handle tbl's T{ ... }T text blocks, and splits
the blocks into separate lines. Fox example the follwing code from the
ps(1) man page:

  %cpu    %CPU    T{
  cpu utilization of the process in "##.#" format.  It is the CPU time
  used divided by the time the process has been running (cputime/realtime
  ratio), expressed as a percentage. It will not add up to 100% unless you
  are lucky.  (alias\ \fBpcpu\fR).
  T}

generates the following msgids:
  msgid "%cpu\t%CPU\tT{\n"
  msgid "cpu utilization of the process in \"##.#\" format.  It is the CPU 
time\n"
  msgid "used divided by the time the process has been running 
(cputime/realtime\n"
  msgid "ratio), expressed as a percentage. It will not add up to 100% unless 
you\n"
  msgid "are lucky.  (alias\\ B<pcpu>).\n"
  msgid "T}\n"
Translating such content seems to be a nightmare.


The attached patch tries to solve the issue by concatenating the lines
inside T{ ... }T - such approach works in most cases.

It does not work however if the T{...}T block contains embeeded macros, like 
for example in the follwing quote of the same ps.1 man page:

  class   CLS     T{
  scheduling class of the process.  (alias\ \fBpolicy\fR,\ \fBcls\fR).
  Field's possible values are:
  .br
  \-      not reported
  .br
  TS      SCHED_OTHER
  .br
  FF      SCHED_FIFO
  .br
  RR      SCHED_RR
  .br
  ?       unknown value
  T}

Without having no idea, how to properly handle this, I've choosen to
fall-back to previous behavior of translating the macro lines
separately - see the TODO comment in the patch. (However to be honest
in my opinion,  even with lack of proper support for embedded macros, 
the patched version is more translator-friendly than the original one,
so I would be grateful if you could apply the patch in following
versions of po4a).


Additionally you may notice that the patch fixes the typo in `split "\\t"'
line so that the tbl data is now properly split into msgids on
tabulators, what I belive was the intention of the author of the code.


Regards,
robert

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (200, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.11-2-686-pae (SMP w/1 CPU core)
Locale: LANG=pl_PL.UTF8, LC_CTYPE=pl_PL.UTF8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages po4a depends on:
ii  gettext        0.18.3.2-1
ii  libsgmls-perl  1.03ii-33
ii  perl           5.18.2-4
ii  perl-modules   5.18.2-4
ii  sp             1.3.4-1.2.1-47.3

Versions of packages po4a recommends:
ii  liblocale-gettext-perl     1.05-8
ii  libterm-readkey-perl       2.32-1
ii  libtext-wrapi18n-perl      0.06-7
pn  libunicode-linebreak-perl  <none>

po4a suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/perl5/Locale/Po4a/Man.pm (from po4a package)
Index: lib/Locale/Po4a/Man.pm
===================================================================
--- lib/Locale/Po4a/Man.pm	(wersja 2754)
+++ lib/Locale/Po4a/Man.pm	(kopia robocza)
@@ -2191,6 +2191,7 @@
 $macro{'TS'}=sub {
     my $self=shift;
     my ($in_headers,$buffer)=(1,"");
+    my ($in_textblock,$preline,$postline)=(0,"","");
     my ($line,$ref)=$self->shiftline();
 
     # Push table start
@@ -2206,18 +2207,49 @@
                 $in_headers = 0;
             }
             $self->pushline($self->r($line));
-        } elsif ($line =~ /\\$/) {
+        } elsif ($in_textblock && $line =~ /^T}\s*/) { # end of text block
+            $in_textblock = 0;
+            $preline = $&; # save the `T}' marker to be output later
+            $line = $';    # save the remaing part of the line
+            $self->pushline($self->translate($buffer,
+                                             $ref,
+                                            'tbl table'));
+            $buffer = "";
+            next; # continue processing with the remaining part of the line
+        } elsif ($in_textblock && $line =~ /^[.']/) {
+            # TODO: properly handle macros inside text blocks, currently we mark them
+            # for translations just like the previous version did
+            $self->pushline($self->translate($buffer,
+                                             $ref,
+                                            'tbl table'));
+            $self->pushline($self->translate($line,
+                                             $ref,
+                                            'tbl table'));
+            $buffer = "";
+        } elsif ($line =~ /\\$/ || $in_textblock) {
             # Lines are continued on \ at the end of line
             $buffer .= $line;
         } else {
+            if ($line =~ s/\s*T{\s*$//) { # start of text block
+              $in_textblock = 1;
+              $postline = $&; # save the `T{' to be outputed below
+            } elsif ($buffer eq "" && $line ne ""){ # single line data
+              chomp $line; # drop eol char from the entry to be translated
+              $postline = "\n"; # and save the eol for output below
+            }
+
             $buffer .= $line;
             # Arguments to translate are separated by \t
-            $self->pushline(join("\t",
-                                 map { $self->translate($buffer,
+            $self->pushline($preline
+                            .join("\t",
+                                 map { $self->translate($_,
                                                         $ref,
                                                         'tbl table')
-                                     } split (/\\t/,$line)));
-            $buffer = "";
+                                     } split (/\t/,$buffer))
+                           .$postline);
+
+            $buffer = $preline = $postline = "";
+ 
         }
         ($line,$ref)=$self->shiftline();
     }

--- End Message ---
--- Begin Message ---
Source: po4a
Source-Version: 0.46-1

We believe that the bug you reported is fixed in the latest version of
po4a, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Quinson <[email protected]> (supplier of updated po4a package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 21 May 2015 00:49:44 +0200
Source: po4a
Binary: po4a
Architecture: source all
Version: 0.46-1
Distribution: unstable
Urgency: medium
Maintainer: Nicolas FRANCOIS (Nekral) <[email protected]>
Changed-By: Martin Quinson <[email protected]>
Description:
 po4a       - tools for helping translation of documentation
Closes: 735644 744366 748601 776896 779435 782393
Changes:
 po4a (0.46-1) unstable; urgency=medium
 .
   * New upstream release.
     This is a long awaited release after almost 2 years!
     The most impressive is not the release content, but the fact that
     I'm back up to speed to maintain and release the po4a project.
     More releases should follow soon.
 .
     - Closes: #744366 (man module mangles preprocessor line)
       Thanks to Robert Luberda for the patch.
     - Closes: #748601 (Man module splits tbl's textblocks into separate lines)
       Thanks to Robert Luberda for the patch.
     - Closes: #779435 (Useless use of greediness modifier)
     - Closes: #782393 (Dutch po file for the po4a package)
     - Closes: #735644 (Brazilian Portuguese PO translation of bin, pod and web)
     - Closes: #776896 (Update Vietnamese program translation)
   * d/control: update VCS fields now that we moved the package to git.
   * d/control: bump the Standards-Version to 3.9.6. No change needed.
Checksums-Sha1:
 acec50c58825135827001a5f5665735fecad5393 2163 po4a_0.46-1.dsc
 42ff3110fc3b38af81e093ea59d70b642e69341f 2387606 po4a_0.46.orig.tar.gz
 d1724027c1429580322d5a7d6291495aacd4fd50 9664 po4a_0.46-1.debian.tar.xz
 b5e744209973365e2ea651128b2ca36e70fc66d6 1450816 po4a_0.46-1_all.deb
Checksums-Sha256:
 541e826cdcc2d5a2e56f868cfd849365a273c2beefb70bb629924967d42f27fa 2163 
po4a_0.46-1.dsc
 3fe32aab3736830935d812218485fc60ed84490a5ad8cb46dbb3acfe0c37af96 2387606 
po4a_0.46.orig.tar.gz
 cf258f7dce637a1824382361a13060d281eef37c893a82dc5d77e50b18470c82 9664 
po4a_0.46-1.debian.tar.xz
 6501f624c0f21199881f6ac3504ab73d5ddfe1aa721019a29d1d7e470381f7a2 1450816 
po4a_0.46-1_all.deb
Files:
 068856424fd01e9ca8790333a90473b3 2163 text optional po4a_0.46-1.dsc
 27bddc74edab0dd0c7615779a9b17506 2387606 text optional po4a_0.46.orig.tar.gz
 b29a89af8ee492c45cd75f7e5d60294b 9664 text optional po4a_0.46-1.debian.tar.xz
 067593d0c5b14440ce2834aeff35539f 1450816 text optional po4a_0.46-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVXRHkAAoJEJi9lyRPc76nlxMP/iQPpaECXelHzAU3ibdw1ecj
WDnqT2tCYgaFt9sQV1NSvpOKSRTGSfJMNpMUZkF5WPzxJLedUlNPm7U22BH+gbPN
51iYza5BAm6JfPyjO59bg0Drn74fyV+eQfNcYxuJ6GfEj/KeNANhM6U6l7Ty3Zx8
yf3J0KyU9xsRcEQBNhvfVo8c5Rmyn9k0S5WhOqIdNgo4IGqnJgK7x+4FXwXnNWKd
AEUfSt1diRiHq8ewdqHDrbY0zwiAjb59QzIHaNrBKjigieu6lfhCcvyDaeXobOBs
7cO0AWxX+oxbCkXVEYH0xbP5bpSIEmNBNbxb/G4EOr1PxbJYqsK1x/546k9DL7/d
JRp7gm4hbuQSxvSPD1dIk0rs1ja1rzk5AQpuN4ugJ1ilNddBZiOCsZSPuBRoGMnr
VCx56U78un2uZo5svIvllvpA7jKb8kxNzfpwc6kbMihsCBkkVNRo2jPgfFfggITu
ztJcOiiVGARCd4REkqivLwjbqfKx3LK3tcFMjvdI/Xf9hgbu92QIkMFI3w2G/Rjq
eOEUN/08EdaCeJp+t3uM05RQgA2l+X4cNO++5QnCgyy4VYfYrt1VGM8n9PAlMSLy
HFYkYhac/Du912j54VBv3l8BJLh+CsHInkhfMYciFv4NMuGXCVraGOpQXzcJCO50
bRoVYpWz9XjGxulgJMeq
=7rwE
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to