[Po4a-commits] po4a/lib/Locale/Po4a TeX.pm,1.25,1.26
Nicolas FRAN??OIS
po4a-devel@lists.alioth.debian.org
Sat, 19 Feb 2005 21:43:11 +0000
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv15583/lib/Locale/Po4a
Modified Files:
TeX.pm
Log Message:
Disable character translations. In pre_trans, it can generate wrong PO. In
post_trans, it will only work for one PO file encoding.
The code is commented because I would like to find a proper way to do this
(it permits to use é instead of \'e in the PO, which also permits to use
spell checkers)
By the way, translate these characters to UTF-8 in the source (so that all
the file is UTF-8 encoded).
Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- TeX.pm 17 Feb 2005 23:25:45 -0000 1.25
+++ TeX.pm 19 Feb 2005 21:43:08 -0000 1.26
@@ -223,15 +223,15 @@
# Accentuated characters
# FIXME: only do this if the encoding is UTF-8?
- $str =~ s/${RE_ESCAPE}`a/à/g;
-# $str =~ s/${RE_ESCAPE}c{c}/ç/g; # not in texinfo: @,{c}
- $str =~ s/${RE_ESCAPE}^e/ê/g;
- $str =~ s/${RE_ESCAPE}'e/é/g;
- $str =~ s/${RE_ESCAPE}`e/è/g;
- $str =~ s/${RE_ESCAPE}`u/ù/g;
- $str =~ s/${RE_ESCAPE}"i/ï/g;
- # Non breaking space. FIXME: should we change $\sim$ to ~
- $str =~ s/~/\xA0/g; # FIXME: not in texinfo: @w{ }
+# $str =~ s/${RE_ESCAPE}`a/Ã /g;
+## $str =~ s/${RE_ESCAPE}c{c}/ç/g; # not in texinfo: @,{c}
+# $str =~ s/${RE_ESCAPE}^e/ê/g;
+# $str =~ s/${RE_ESCAPE}'e/é/g;
+# $str =~ s/${RE_ESCAPE}`e/è/g;
+# $str =~ s/${RE_ESCAPE}`u/ù/g;
+# $str =~ s/${RE_ESCAPE}"i/ï/g;
+# # Non breaking space. FIXME: should we change $\sim$ to ~
+# $str =~ s/~/\xA0/g; # FIXME: not in texinfo: @w{ }
print STDERR "$str\n" if ($debug{'pretrans'});
return $str;
@@ -245,15 +245,15 @@
if ($debug{'postrans'});
# Accentuated characters
- $str =~ s/à/${ESCAPE}`a/g;
-# $str =~ s/ç/$ESCAPEc{c}/g; # FIXME: not in texinfo
- $str =~ s/ê/${ESCAPE}^e/g;
- $str =~ s/é/${ESCAPE}'e/g;
- $str =~ s/è/${ESCAPE}`e/g;
- $str =~ s/ù/${ESCAPE}`u/g;
- $str =~ s/ï/${ESCAPE}"i/g;
- # Non breaking space. FIXME: should we change ~ to $\sim$
- $str =~ s/\xA0/~/g; # FIXME: not in texinfo
+# $str =~ s/Ã /${ESCAPE}`a/g;
+## $str =~ s/ç/$ESCAPEc{c}/g; # FIXME: not in texinfo
+# $str =~ s/ê/${ESCAPE}^e/g;
+# $str =~ s/é/${ESCAPE}'e/g;
+# $str =~ s/è/${ESCAPE}`e/g;
+# $str =~ s/ù/${ESCAPE}`u/g;
+# $str =~ s/ï/${ESCAPE}"i/g;
+# # Non breaking space. FIXME: should we change ~ to $\sim$
+# $str =~ s/\xA0/~/g; # FIXME: not in texinfo
print STDERR "$str\n" if ($debug{'postrans'});
return $str;
@@ -654,13 +654,13 @@
my $self=shift;
my $filename=shift
or croak wrap_mod("po4a::tex",
- dgettext("po4a", "Can't read from file without having a filename"));
+ dgettext("po4a", "Can't read from file without having a filename"));
my $linenum=0;
my @entries=();
open (my $in, $filename)
or croak wrap_mod("po4a::tex",
- dgettext("po4a", "Can't read from %s: %s"), $filename, $!);
+ dgettext("po4a", "Can't read from %s: %s"), $filename, $!);
while (defined (my $textline = <$in>)) {
$linenum++;
my $ref="$filename:$linenum";
@@ -711,7 +711,7 @@
}
close $in
or croak wrap_mod("po4a::tex",
- dgettext("po4a", "Can't close %s after reading: %s"), $filename, $!);
+ dgettext("po4a", "Can't close %s after reading: %s"), $filename, $!);
return @entries;
}
@@ -772,7 +772,7 @@
open (IN,"<$my_dirname/$filename")
|| die wrap_mod("po4a::tex",
- dgettext("po4a", "Can't open %s: %s"), $filename, $!);
+ dgettext("po4a", "Can't open %s: %s"), $filename, $!);
while (<IN>) {
if (/^%\s+po4a:/) {
parse_definition_line($self, $_);
@@ -823,7 +823,7 @@
sub is_closed {
my $paragraph = shift;
-# FIXME: [ and ] are more difficult to handle, because it is not easy to detect if it introduce an optional argument
+# FIXME: [ and ] are more difficult to handle, because it is not easy to detect if it introduce an optional argument
my $tmp = $paragraph;
my $closing = 0;
my $opening = 0;