[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.132,1.133"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sun Mar 19 22:54:58 UTC 2006
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv19469/lib/Locale/Po4a
Modified Files:
Man.pm
Log Message:
Move the punctuation out of the E<...> markups. This should be easier for
the translators.
Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- Man.pm 19 Mar 2006 18:19:18 -0000 1.132
+++ Man.pm 19 Mar 2006 22:54:56 -0000 1.133
@@ -768,6 +768,17 @@
while ($str =~ m/^(.*)PO4A-INLINE:(.*?):PO4A-INLINE(.*)$/s) {
my ($t1,$t2, $t3) = ($1, $2, $3);
$str = "$1E<$2>";
+ if ($mdoc_mode) {
+ # When a punctuation sign must be joined to an argument, mdoc
+ # permits to use such a construct:
+ # .Ar file1 , file2 , file3 ) .
+ # Here, we move the punctuation out of the E<...> tag.
+ # This is reverted in post_trans.
+ # FIXME: To be checked with the French punctuation
+ while ($str =~ m/ +([.,;:\)\]]) *>/s) {
+ $str =~ s/ +([.,;:\)\]]) *>/>$1/s;
+ }
+ }
if (defined $t3 and length $t3) {
$t3 =~ s/^\n//s;
$str .= "\n$t3";
@@ -917,6 +928,14 @@
my ($t1, $t2, $t3) = ($1,$2,$3);
$t1 =~ s/ +$//s;
$t2 =~ s/\n/ /gs;
+ if ($mdoc_mode) {
+ # restore the punctuaction inside the line (see pre_trans)
+ if ($t3 =~ s/^([.,;:\)\]]+)(?: +|$)//s) {
+ my $punctuation = $1;
+ $punctuation =~ s/([.,;:\)\]])/$1 /;
+ $t2 .= " $punctuation";
+ }
+ }
$t3 =~ s/^ +//s;
if ($wrap) {
# The no-wrap case should be checked
More information about the Po4a-commits
mailing list