version 1.25, 2003/10/11 21:06:11
|
version 1.26, 2003/11/07 23:22:22
|
Line 171 require Exporter;
|
Line 171 require Exporter;
|
our @ISA = qw (Exporter); |
our @ISA = qw (Exporter); |
our @EXPORT = qw(mt mtn ns); |
our @EXPORT = qw(mt mtn ns); |
|
|
my $reroute; |
|
|
|
# ========================================================= The language handle |
# ========================================================= The language handle |
|
|
use vars qw($lh); |
use vars qw($lh); |
Line 181 use vars qw($lh);
|
Line 179 use vars qw($lh);
|
|
|
sub mt (@) { |
sub mt (@) { |
# my $fh=Apache::File->new('>>/home/www/loncapa/loncom/localize/localize/newphrases.txt'); |
# my $fh=Apache::File->new('>>/home/www/loncapa/loncom/localize/localize/newphrases.txt'); |
# print $fh join('',@_)."\n"; |
# print $fh @_[0]."\n"; |
# $fh->close(); |
# $fh->close(); |
unless ($ENV{'environment.translator'}) { |
if ($lh) { |
if ($lh) { |
return $lh->maketext(@_); |
return $lh->maketext(@_); |
|
} else { |
|
return @_; |
|
} |
|
} else { |
} else { |
if ($lh) { |
return @_; |
my $trans=$lh->maketext(@_); |
|
my $link='<a target="trans" href="/cgi-bin/translator.pl?arg1='. |
|
&Apache::lonnet::escape($_[0]).'&arg2='. |
|
&Apache::lonnet::escape($_[1]).'&arg3='. |
|
&Apache::lonnet::escape($_[2]).'&lang='. |
|
$ENV{'environment.translator'}. |
|
'">[['.$trans.']]</a>'; |
|
if ($ENV{'transreroute'}) { |
|
$reroute.=$link; |
|
return $trans; |
|
} else { |
|
return $link; |
|
} |
|
} else { |
|
return @_; |
|
} |
|
} |
} |
} |
} |
|
|
Line 252 sub texthash {
|
Line 230 sub texthash {
|
} |
} |
return %hash; |
return %hash; |
} |
} |
# ======================================================== Re-route translation |
|
|
|
sub clearreroutetrans { |
|
&reroutetrans(); |
|
$reroute=''; |
|
} |
|
|
|
# ======================================================== Re-route translation |
|
|
|
sub reroutetrans { |
|
$ENV{'transreroute'}=1; |
|
} |
|
|
|
# ==================================================== End re-route translation |
|
sub endreroutetrans { |
|
$ENV{'transreroute'}=0; |
|
if ($ENV{'environment.translator'}) { |
|
return $reroute; |
|
} else { |
|
return ''; |
|
} |
|
} |
|
|
|
# ========= Get a handle (do not invoke in vain, leave this to access handlers) |
# ========= Get a handle (do not invoke in vain, leave this to access handlers) |
|
|