[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonmsg.pm lonprintout.pm lonstatistics.pm
www
lon-capa-cvs@mail.lon-capa.org
Wed, 15 Oct 2003 18:01:10 -0000
This is a MIME encoded message
--www1066240870
Content-Type: text/plain
www Wed Oct 15 14:01:10 2003 EDT
Modified files:
/loncom/interface lonhtmlcommon.pm lonmsg.pm lonprintout.pm
lonstatistics.pm
Log:
I was going to work on something else ... anyway, more i18n.
--www1066240870
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20031015140110.txt"
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.31 loncom/interface/lonhtmlcommon.pm:1.32
--- loncom/interface/lonhtmlcommon.pm:1.31 Tue Oct 14 14:36:54 2003
+++ loncom/interface/lonhtmlcommon.pm Wed Oct 15 14:01:10 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.31 2003/10/14 18:36:54 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.32 2003/10/15 18:01:10 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -748,7 +748,8 @@
"<body bgcolor=\"#88DDFF\">".
"<h4>$heading</h4>".
"<form name=popremain>".
- '<input type="text" size="55" name="remaining" value="Starting"></form>'.
+ '<input type="text" size="55" name="remaining" value="'.
+ &mt('Starting').'"></form>'.
"</body></html>\');".
"popwin.document.close();".
"</script>");
@@ -803,9 +804,9 @@
$lasttime = sprintf("%3.2f",$lasttime);
}
if ($lasttime == 1) {
- $lasttime = '('.$lasttime.' '.&mt('second for').' '.&mt($extraInfo).')';
+ $lasttime = '('.$lasttime.' '.&mt('second for').' '.$extraInfo.')';
} else {
- $lasttime = '('.$lasttime.' '.&mt('seconds for').' '.&mt($extraInfo).')';
+ $lasttime = '('.$lasttime.' '.&mt('seconds for').' '.$extraInfo.')';
}
#
my $user_browser = $ENV{'browser.type'} if (exists($ENV{'browser.type'}));
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.66 loncom/interface/lonmsg.pm:1.67
--- loncom/interface/lonmsg.pm:1.66 Sat Oct 4 16:49:40 2003
+++ loncom/interface/lonmsg.pm Wed Oct 15 14:01:10 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging
#
-# $Id: lonmsg.pm,v 1.66 2003/10/04 20:49:40 www Exp $
+# $Id: lonmsg.pm,v 1.67 2003/10/15 18:01:10 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -115,6 +115,7 @@
use Apache::lontexconvert();
use HTML::Entities();
use Mail::Send;
+use Apache::lonlocal;
# Querystring component with sorting type
my $sqs;
@@ -143,7 +144,7 @@
my $result='<sendername>'.$ENV{'user.name'}.'</sendername>'.
'<senderdomain>'.$ENV{'user.domain'}.'</senderdomain>'.
'<subject>'.$subject.'</subject>'.
- '<time>'.localtime($now).'</time>'.
+ '<time>'.&Apache::lonlocal::locallocaltime($now).'</time>'.
'<servername>'.$ENV{'SERVER_NAME'}.'</servername>'.
'<host>'.$ENV{'HTTP_HOST'}.'</host>'.
'<client>'.$ENV{'REMOTE_ADDR'}.'</client>'.
@@ -186,9 +187,9 @@
if ($content{'attachmenturl'}) {
my ($fname,$ft)=($content{'attachmenturl'}=~/\/(\w+)\.(\w+)$/);
if ($notoken) {
- $content{'message'}.='<p>Attachment: <tt>'.$fname.'.'.$ft.'</tt>';
+ $content{'message'}.='<p>'.&mt('Attachment').': <tt>'.$fname.'.'.$ft.'</tt>';
} else {
- $content{'message'}.='<p>Attachment: <a href="'.
+ $content{'message'}.='<p>'.&mt('Attachment').': <a href="'.
&Apache::lonnet::tokenwrapper($content{'attachmenturl'}).
'"><tt>'.$fname.'.'.$ft.'</tt></a>';
}
@@ -212,8 +213,8 @@
sub sendemail {
my ($to,$subject,$body)=@_;
$body=
- "*** This is an automatic message generated by the LON-CAPA system.\n".
- "*** Please do not reply to this address.\n\n".$body;
+ "*** ".&mt('This is an automatic message generated by the LON-CAPA system.')."\n".
+ "*** ".&mt('Please do not reply to this address.')."\n\n".$body;
my $msg = new Mail::Send;
$msg->to($to);
$msg->subject('[LON-CAPA] '.$subject);
@@ -362,10 +363,10 @@
my %contents=&unpackagemsg($message{$msgid},1);
my $status='rec: '.($contents{'sendback'}?
&user_normal_msg($contents{'sendername'},$contents{'senderdomain'},
- 'Receipt: '.$ENV{'user.name'}.' at '.$ENV{'user.domain'},
- 'User '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}.
+ &mt('Receipt').': '.$ENV{'user.name'}.' at '.$ENV{'user.domain'},
+ &mt('User').' '.$ENV{'user.name'}.' '.&mt('at').' '.$ENV{'user.domain'}.
' acknowledged receipt of message'."\n".' "'.
- $contents{'subject'}.'"'."\n".'dated '.
+ $contents{'subject'}.'"'."\n".&mt('dated').' '.
$contents{'time'}.".\n"
):'no msg req');
$status.=' trans: '.
@@ -469,6 +470,9 @@
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
$ENV{'course.'.$ENV{'request.course.id'}.'.num'});
my $now=time;
+ my %lt=&Apache::lonlocal::texthash('cfa' => 'Check for All',
+ 'cfs' => 'Check for Section/Group',
+ 'cfn' => 'Check for None');
$r->print(<<ENDDISHEADER);
<input type=hidden name=sendmode value=group>
<script>
@@ -500,10 +504,10 @@
}
}
</script>
-<input type=button onClick="checkall()" value="Check for All">
-<input type=button onClick="checksec()" value="Check for Section/Group">
+<input type=button onClick="checkall()" value="$lt{'cfa'}">
+<input type=button onClick="checksec()" value="$lt{'cfs'}">
<input type=text size=5 name=chksec>
-<input type=button onClick="uncheckall()" value="Check for None">
+<input type=button onClick="uncheckall()" value="$lt{'cfn'}">
<p>
ENDDISHEADER
my %coursepersonnel=
@@ -545,7 +549,7 @@
sub discrit {
my $r=shift;
- my $header = '<h1><font color=red>Critical Messages</font></h1>'.
+ my $header = '<h1><font color=red>'.&mt('Critical Messages').'</font></h1>'.
'<form action=/adm/email method=post>'.
'<input type=hidden name=confirm value=true>';
my %what=&Apache::lonnet::dump('critical');
@@ -554,23 +558,23 @@
my %content=&unpackagemsg($what{$_});
next if ($content{'senderdomain'} eq '');
$content{'message'}=~s/\n/\<br\>/g;
- $result.='<hr>From: <b>'.
+ $result.='<hr>'.&mt('From').': <b>'.
&Apache::loncommon::aboutmewrapper(
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).'</b> ('.
$content{'sendername'}.'@'.
$content{'senderdomain'}.') '.$content{'time'}.
- '<br>Subject: '.$content{'subject'}.
+ '<br>'.&mt('Subject').': '.$content{'subject'}.
'<br><blockquote>'.
&Apache::lontexconvert::msgtexconverted($content{'message'}).
'</blockquote>'.
- '<input type=submit name="rec_'.$_.'" value="Confirm Receipt">'.
+ '<input type=submit name="rec_'.$_.'" value="'.&mt('Confirm Receipt').'">'.
'<input type=submit name="reprec_'.$_.'" '.
- 'value="Confirm Receipt and Reply">';
+ 'value="'.&mt('Confirm Receipt and Reply').'">';
}
# Check to see if there were any messages.
if ($result eq '') {
- $result = "<h2>You have no critical messages.</h2>".
- '<a href="/adm/roles">Select a course</a>';
+ $result = "<h2>".&mt('You have no critical messages.')."</h2>".
+ '<a href="/adm/roles">'.&mt('Select a course').'</a>';
} else {
$r->print($header);
}
@@ -592,15 +596,15 @@
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),$content{'sendername'},$content{'senderdomain'}).' ('.
$content{'sendername'}.'@'.
$content{'senderdomain'}.')';
- my $subject='Re: '.$content{'subject'};
+ my $subject=&mt('Re').': '.$content{'subject'};
my $dispcrit='';
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
$dispcrit=
- '<input type=checkbox name=critmsg> Send as critical message ' . $crithelp .
+ '<input type=checkbox name=critmsg> '.&mt('Send as critical message').' ' . $crithelp .
'<br>'.
- '<input type=checkbox name=sendbck> Send as critical message ' .
- ' and return receipt' . $crithelp . '<p>';
+ '<input type=checkbox name=sendbck> '.&mt('Send as critical message').' ' .
+ &mt('and return receipt') . $crithelp . '<p>';
}
$r->print(<<"ENDREPLY");
<form action="/adm/email" method=post>
@@ -688,37 +692,37 @@
}
</script>
ENDDISHEADER
- $r->print('<h1>Display All Messages</h1><form method=post name=disall '.
+ $r->print('<h1>'.&mt('Display All Messages').'</h1><form method=post name=disall '.
'action="/adm/email">'.
'<table border=2><tr><th colspan=2> </th><th>');
if ($ENV{'form.sortedby'} eq "revdate") {
- $r->print('<a href = "?sortedby=date">Date</a></th>');
+ $r->print('<a href = "?sortedby=date">'.&mt('Date').'</a></th>');
} else {
- $r->print('<a href = "?sortedby=revdate">Date</a></th>');
+ $r->print('<a href = "?sortedby=revdate">'.&mt('Date').'</a></th>');
}
$r->print('<th>');
if ($ENV{'form.sortedby'} eq "revuser") {
- $r->print('<a href = "?sortedby=user">Username</a>');
+ $r->print('<a href = "?sortedby=user">'.&mt('Username').'</a>');
} else {
- $r->print('<a href = "?sortedby=revuser">Username</a>');
+ $r->print('<a href = "?sortedby=revuser">'.&mt('Username').'</a>');
}
$r->print('</th><th>');
if ($ENV{'form.sortedby'} eq "revdomain") {
- $r->print('<a href = "?sortedby=domain">Domain</a>');
+ $r->print('<a href = "?sortedby=domain">'.&mt('Domain').'</a>');
} else {
- $r->print('<a href = "?sortedby=revdomain">Domain</a>');
+ $r->print('<a href = "?sortedby=revdomain">'.&mt('Domain').'</a>');
}
$r->print('</th><th>');
if ($ENV{'form.sortedby'} eq "revsubject") {
- $r->print('<a href = "?sortedby=subject">Subject</a>');
+ $r->print('<a href = "?sortedby=subject">'.&mt('Subject').'</a>');
} else {
- $r->print('<a href = "?sortedby=revsubject">Subject</a>');
+ $r->print('<a href = "?sortedby=revsubject">'.&mt('Subject').'</a>');
}
$r->print('</th><th>');
if ($ENV{'form.sortedby'} eq "revstatus") {
- $r->print('<a href = "?sortedby=status">Status</th>');
+ $r->print('<a href = "?sortedby=status">'.&mt('Status').'</th>');
} else {
- $r->print('<a href = "?sortedby=revstatus">Status</th>');
+ $r->print('<a href = "?sortedby=revstatus">'.&mt('Status').'</th>');
}
$r->print('</tr>');
my @temp=sortedmessages();
@@ -735,8 +739,8 @@
$r->print('<tr bgcolor="#99BBBB">');
}
$r->print('<td><a href="/adm/email?display='.$origID.$sqs.
- '">Open</a></td><td><a href="/adm/email?markdel='.$origID.$sqs.
- '">Delete</a><input type=checkbox name="delmark_'.$origID.'"></td>'.
+ '">'.&mt('Open').'</a></td><td><a href="/adm/email?markdel='.$origID.$sqs.
+ '">'.&mt('Delete').'</a><input type=checkbox name="delmark_'.$origID.'"></td>'.
'<td>'.&Apache::lonlocal::locallocaltime($sendtime).'</td><td>'.
$fromname.'</td><td>'.$fromdomain.'</td><td>'.
&Apache::lonnet::unescape($shortsubj).'</td><td>'.
@@ -744,10 +748,10 @@
}
}
$r->print('</table><p>'.
- '<a href="javascript:checkall()">Check All</a> '.
- '<a href="javascript:uncheckall()">Uncheck All</a><p>'.
+ '<a href="javascript:checkall()">'.&mt('Check All').'</a> '.
+ '<a href="javascript:uncheckall()">'.&mt('Uncheck All').'</a><p>'.
'<input type="hidden" name="sortedby" value="'.$ENV{'form.sortedby'}.'" />'.
- '<input type=submit name="markeddel" value="Delete Checked">'.
+ '<input type=submit name="markeddel" value="'.&mt('Delete Checked').'">'.
'</form></body></html>');
}
@@ -758,25 +762,25 @@
my $dispcrit='';
my $dissub='';
my $dismsg='';
- my $func='Send New';
+ my $func=&mt('Send New');
if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
my $crithelp = Apache::loncommon::help_open_topic("Course_Critical_Message");
$dispcrit=
- '<input type=checkbox name=critmsg> Send as critical message ' . $crithelp .
+ '<input type=checkbox name=critmsg> '.&mt('Send as critical message').' ' . $crithelp .
'<br>'.
- '<input type=checkbox name=sendbck> Send as critical message ' .
- ' and return receipt' . $crithelp . '<p>';
+ '<input type=checkbox name=sendbck> '.&mt('Send as critical message').' ' .
+ &mt('and return receipt') . $crithelp . '<p>';
}
if ($forwarding) {
$dispcrit.='<input type=hidden name=forwid value="'.
$forwarding.'">';
- $func='Forward';
+ $func=&mt('Forward');
my %message=&Apache::lonnet::get('nohist_email',[$forwarding]);
my %content=&unpackagemsg($message{$forwarding});
- $dissub='Forwarding: '.$content{'subject'};
- $dismsg='Forwarded message from '.
- $content{'sendername'}.' at '.$content{'senderdomain'};
+ $dissub=&mt('Forwarding').': '.$content{'subject'};
+ $dismsg=&mt('Forwarded message from').' '.
+ $content{'sendername'}.' '.&mt('at').' '.$content{'senderdomain'};
}
my $defdom=$ENV{'user.domain'};
if ($ENV{'form.recdom'}) { $defdom=$ENV{'form.recdom'}; }
@@ -955,7 +959,7 @@
# ----------------------------------------------------------- Set document type
- $r->content_type('text/html');
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK if $r->header_only;
@@ -1000,32 +1004,32 @@
$r->print(&Apache::loncommon::studentbrowser_javascript().
'</head>'.
&Apache::loncommon::bodytag('EMail and Messages'));
- $r->print('<b>Subject:</b> '.$content{'subject'}.
- '<br><b>From:</b> '.
+ $r->print('<b>'.&mt('Subject').':</b> '.$content{'subject'}.
+ '<br><b>'.&mt('From').':</b> '.
&Apache::loncommon::aboutmewrapper(
&Apache::loncommon::plainname($content{'sendername'},$content{'senderdomain'}),
$content{'sendername'},$content{'senderdomain'}).' ('.
$content{'sendername'}.' at '.
$content{'senderdomain'}.') '.
- '<br><b>Time:</b> '.$content{'time'}.'<p>'.
- '<table border=2><tr bgcolor="#FFFFAA"><td>Functions:</td>'.
+ '<br><b>'.&mt('Time').':</b> '.$content{'time'}.'<p>'.
+ '<table border=2><tr bgcolor="#FFFFAA"><td>'.&mt('Functions').':</td>'.
'<td><a href="/adm/email?replyto='.&Apache::lonnet::escape($msgid).$sqs.
- '"><b>Reply</b></a></td>'.
+ '"><b>'.&mt('Reply').'</b></a></td>'.
'<td><a href="/adm/email?forward='.&Apache::lonnet::escape($msgid).$sqs.
- '"><b>Forward</b></a></td>'.
+ '"><b>'.&mt('Forward').'</b></a></td>'.
'<td><a href="/adm/email?markunread='.&Apache::lonnet::escape($msgid).$sqs.
- '"><b>Mark Unread</b></a></td>'.
+ '"><b>'.&mt('Mark Unread').'</b></a></td>'.
'<td><a href="/adm/email?markdel='.&Apache::lonnet::escape($msgid).$sqs.
'"><b>Delete</b></a></td>'.
'<td><a href="/adm/email?sortedby='.$ENV{'form.sortedby'}.
- '"><b>Display all Messages</b></a></td>');
+ '"><b>'.&mt('Display all Messages').'</b></a></td>');
if ($counter > 0){
$r->print('<td><a href="/adm/email?display='.$messages[$counter-1]->[5].$sqs.
- '"><b>Previous</b></a></td>');
+ '"><b>'.&mt('Previous').'</b></a></td>');
}
if ($counter < $number_of_messages - 1){
$r->print('<td><a href="/adm/email?display='.$messages[$counter+1]->[5].$sqs.
- '"><b>Next</b></a></td>');
+ '"><b>'.&mt('Next').'</b></a></td>');
}
$r->print('</tr></table><p><pre>'.
&Apache::lontexconvert::msgtexconverted($content{'message'}).
@@ -1039,14 +1043,14 @@
&statuschange($msgid,'replied');
if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) &&
(&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
- $r->print('Sending critical: '.
+ $r->print(&mt('Sending critical').': '.
&user_crit_msg($content{'sendername'},
$content{'senderdomain'},
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
&Apache::lonfeedback::clear_out_html($ENV{'form.message'}),
$ENV{'form.sendbck'}));
} else {
- $r->print('Sending: '.&user_normal_msg($content{'sendername'},
+ $r->print(&mt('Sending').': '.&user_normal_msg($content{'sendername'},
$content{'senderdomain'},
&Apache::lonfeedback::clear_out_html($ENV{'form.subject'}),
&Apache::lonfeedback::clear_out_html($ENV{'form.message'})));
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.254 loncom/interface/lonprintout.pm:1.255
--- loncom/interface/lonprintout.pm:1.254 Fri Oct 10 09:38:26 2003
+++ loncom/interface/lonprintout.pm Wed Oct 15 14:01:10 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.254 2003/10/10 13:38:26 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.255 2003/10/15 18:01:10 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,17 +25,6 @@
#
# http://www.lon-capa.org/
#
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1 Gerd Kortemeyer
-#
-# 9/17 Alex Sakharuk
#
package Apache::lonprintout;
@@ -51,6 +40,7 @@
use Apache::lonnavmaps;
use Apache::lonratedt;
use POSIX qw(strftime);
+use Apache::lonlocal;
use GDBM_File;
@@ -986,7 +976,7 @@
&Apache::lonnet::delenv('form.counter');
&Apache::lonxml::init_counter();
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student '.$fullname);
+ &mt('last student').' '.$fullname);
}
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
$result .= '\end{document}';
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.85 loncom/interface/lonstatistics.pm:1.86
--- loncom/interface/lonstatistics.pm:1.85 Wed Oct 8 11:32:00 2003
+++ loncom/interface/lonstatistics.pm Wed Oct 15 14:01:10 2003
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstatistics.pm,v 1.85 2003/10/08 15:32:00 matthew Exp $
+# $Id: lonstatistics.pm,v 1.86 2003/10/15 18:01:10 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -898,7 +898,7 @@
($student->{'username'},$student->{'domain'},
$ENV{'request.course.id'});
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last student');
+ &mt('last student'));
}
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
$r->rflush();
--www1066240870--