[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.171,1.172"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Mon Jul 17 21:06:32 UTC 2006
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv22163/lib/Locale/Po4a
Modified Files:
Man.pm
Log Message:
When a string is quoted, only translate the argument between the
quotes, and restore the quotes latter.
Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -d -r1.171 -r1.172
--- Man.pm 17 Jul 2006 21:01:53 -0000 1.171
+++ Man.pm 17 Jul 2006 21:06:29 -0000 1.172
@@ -1009,6 +1009,16 @@
# \&. This is usefull because we introduced \& in shiftline.
return $str if ($str =~ m/^($FONT_RE|\s|\\&)*$/);
+ # If a string is quoted, only translate the argument between the
+ # quotes.
+ if ($options{'wrap'} or $str !~ m/\n/s) {
+ if ($str =~ m/^\"(.*)\"$/s and $1 !~ m/(?<!\\)\"/) {
+ $str = '"'.$self->translate($1, $ref, $type, %options).'"';
+ $str =~ s/\n"$/"\n/s;
+ return $str;
+ }
+ }
+
$str=pre_trans($self,$str,$ref||$self->{ref},$type);
$options{'comment'} .= join('\n', @comments);
# Translate this
More information about the Po4a-commits
mailing list