Bug#684137: po4a: Incorrect handling of in docbook, should be inline?

August 07th, 2012 - 06:10 am ET by Petter Reinholdtsen | Report spam
Package: po4a
Version: 0.40.2-1
Tags: patch

If I understand docbook correctly, the <beginpage> tag is used to
indicate a page break in a legacy version of the document being
processed (for example dokumenting the fact that the original version of
the book had a page break at that point in the text. See the definition
at <URL: http://www.docbook.org/tdg/en/html/beginpage.html >.

when I use it like this in a docbook document, I do not get the expected
result from po4a:

<para>
A single paragraph of text at the end of one page, which eventually
moved on to <beginpage/>the next page.
</para>

When processed by po4a, I get two strings to translate instead of the
complete paragraph I expected. Can po4a be changed to include the
<beginpage> tag in the text to be translated instead of splitting
strings when it is found?

I suspect a patch like this would solve it, but it is not tested.

/usr/share/perl5/Locale/Po4a/Docbook.pm 2010-12-05 01:12:35.000000000 +0100
+++ /tmp/Docbook.pm 2012-08-07 11:50:27.144018129 +0200
@@ -246,7 +246,7 @@

# beginpage; does not contain text; v4, not in v5
$self->{options}{'_default_untranslated'} .= " <beginpage>";
- $self->{options}{'_default_break'} .= " <beginpage>";
+ $self->{options}{'_default_inline'} .= " <beginpage>";

# bibliocoverage; contains text; Formatted inline
# NOTE: could be in the break class

Happy hacking
Petter Reinholdtsen


To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 2 repliesReplies Make a reply

Similar topics

Replies

#1 David Prévot
August 07th, 2012 - 11:20 am ET | Report spam
Hash: SHA256

Control: tags -1 patch

Hi Petter,

Thanks for your report, and patch.

Le 07/08/2012 05:57, Petter Reinholdtsen a écrit :

I suspect a patch like this would solve it, but it is not tested.



Note that you can simply (temporarily) override the distribution file to
test if it behaves as expected, and before it get fixed in po4a, you can
use the following options to override the default behavior:

-o nodefault='<beginpage>' -o inline='<beginpage>'

/usr/share/perl5/Locale/Po4a/Docbook.pm 2010-12-05 01:12:35.000000000 +0100
+++ /tmp/Docbook.pm 2012-08-07 11:50:27.144018129 +0200
@@ -246,7 +246,7 @@

# beginpage; does not contain text; v4, not in v5
$self->{options}{'_default_untranslated'} .= " <beginpage>";
- $self->{options}{'_default_break'} .= " <beginpage>";
+ $self->{options}{'_default_inline'} .= " <beginpage>";

# bibliocoverage; contains text; Formatted inline
# NOTE: could be in the break class



Regards

David



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#2 Petter Reinholdtsen
August 07th, 2012 - 12:00 pm ET | Report spam
[David Prévot]
Note that you can simply (temporarily) override the distribution
file to test if it behaves as expected, and before it get fixed in
po4a, you can use the following options to override the default
behavior:

-o nodefault='<beginpage>' -o inline='<beginpage>'



Ah, great. It resulted in this:

msgid ""
"A single paragraph of text at the end of one page, which eventually moved on "
"to <beginpage pagenum=\"1\"/>the next page."
msgstr ""

And it is OK for my purpose. It might be better to put a placeholder
in there, but I am not sure.

If you want to look at the docbook project I am working on, it is
available from <URL: https://github.com/petterreinholdts...ure-lessig >.
I create/update a docbook version of Free Culture by Lawrence Lessig,
and translate it to Norwegian using po4a. :)

Happy hacking
Petter Reinholdtsen


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search