[Po4a-devel] Font problem in man gettextization

Denis Barbier bouzim at gmail.com
Mon Jul 19 13:21:48 UTC 2010


On 2010/7/14 David Prévot wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I'm trying to make schroot documentation available for translation [1],
> but some font modifier like \f[CBI], \f[CI] or \f[BI] appear not to be
> handled.
>
> [1]http://bugs.debian.org/588962
>
> Some comments in Locale::Po4a::Man made me think it could be handled :
>
> # A font start by \f and is followed either by
> # [.*] - a font name within brackets (e.g. [P], [A_USER_FONT])
> # (..  - a parenthesis followed by two char (e.g. "(CW")
> # .    - a single char (e.g. B, I, R, P, 1, 2, 3, 4, etc.)
> my $FONT_RE = "\\\\f(?:\\[[^\\]]*\\]|\\(..|[^\\(\\[])";
>
> This comment was added in r1.49 [2], but I fail to understand if the
> \f[.*] form has ever been supported.
>
> [2]http://alioth.debian.org/scm/viewvc.php/po4a/lib/Locale/Po4a/Man.pm?root=po4a&view=diff&r1=1.48&r2=1.49
>
> I guess that using PO tags like "CBI<my CBI text>" is not a good idea
> since it would be changed to something like "CB\fImy CBI text\fP" when
> the translated manpage will be generated, and I wonder if there is some
> issue using something like "[CBI]<my CBI text>" or even if keeping the
> groff tags unmodified "\f[CBI]my CBI text\fP" would be acceptable.
>
> Thanks in advance for your advice. Maybe I'm just missing something
> obvious, if not, I'm willing to give a try in patching
> Locale::Po4a::Man in order to use "[.+]<...>" tags, or keeping stuff
> like "\f[.+]my CBI text\fP" , please tel me which form would be best.

Hello,

I would say that you are right, it seems that those font modifiers are
not supported, here is a patch.

--- lib/Locale/Po4a/Man.pm
+++ lib/Locale/Po4a/Man.pm
@@ -1638,7 +1638,7 @@
                 $elem =~ s/^3/B/;
                 $elem =~ s/^4/(BI/;

-            if ($elem =~ /^([1-4]|B|I|R|\(CW|\[\]|\[P\]|L)(.*)$/s) {
+            if ($elem =~ /^([1-4]|B|I|R|\(..|\[[^]]*\]|L)(.*)$/s) {
                 # Each element should now start by a recognized font modifier
                 my $new_font = $1;
                 my $arg = $2;

Anyway schroot manual pages are really terrible because of all these
formatting macros; IMO the attached schroot.1.in is much nicer to
translators.  If you also prefer the POT file generated by this one,
you could ask your upstream to make similar changes into other manual
pages.

Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schroot.1.in
Type: application/octet-stream
Size: 23275 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/po4a-devel/attachments/20100719/8962358d/attachment-0001.obj>


More information about the Po4a-devel mailing list