-----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?roo...
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