[LON-CAPA-cvs] cvs: loncom /interface lonhelp.pm
www
lon-capa-cvs@mail.lon-capa.org
Mon, 22 Sep 2003 04:14:04 -0000
www Mon Sep 22 00:14:04 2003 EDT
Modified files:
/loncom/interface lonhelp.pm
Log:
Localized help files
(original name)_(language code).tex
sent out if present.
Index: loncom/interface/lonhelp.pm
diff -u loncom/interface/lonhelp.pm:1.9 loncom/interface/lonhelp.pm:1.10
--- loncom/interface/lonhelp.pm:1.9 Thu Aug 28 22:45:07 2003
+++ loncom/interface/lonhelp.pm Mon Sep 22 00:14:04 2003
@@ -150,6 +150,8 @@
return HTTP_NOT_FOUND if ($filenames !~ /\A[-0-9a-zA-z_'',:.]+\Z/);
+ &Apache::lonlocal::get_language_handle($r);
+
# Join together the tex files, return HTTP_NOT_FOUND if any of
# them are not found
my $tex = '';
@@ -160,6 +162,10 @@
my @files = split(/,/, $filenames);
for my $filename (@files) {
+ if (-e $docroot.'/adm/help/tex/'.$filename.'_'.
+ &Apache::lonlocal::current_language().'.tex') {
+ $filename.='_'.&Apache::lonlocal::current_language();
+ }
(my $file = Apache::File->new($docroot
. '/adm/help/tex/'.$filename.'.tex'))
or return HTTP_NOT_FOUND;
@@ -170,7 +176,7 @@
&Apache::lonacc::handler($r);
if ($ENV{'browser.mathml'}) {
- $r->content_type('text/xml');
+ &Apache::loncommon::content_type($r,'text/xml');
&tth::ttminit();
if ($ENV{'browser.unicode'}) {
&tth::ttmoptions('-L -u1');
@@ -178,7 +184,7 @@
&tth::ttmoptions('-L -u0');
}
} else {
- $r->content_type("text/html");
+ &Apache::loncommon::content_type($r,"text/html");
&tth::tthinit();
if ($ENV{'browser.unicode'}) {
&tth::tthoptions('-L -u1');