[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonannounce.pm loncommunicate.pm londocs.pm lonmeta.pm lonmsg.pm lonsyllabus.pm /localize lonlocal.pm /localize/localize ja.pm pt.pm /publisher lonpubdir.pm /xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 04 Oct 2003 20:49:40 -0000


This is a MIME encoded message

--www1065300580
Content-Type: text/plain

www		Sat Oct  4 16:49:40 2003 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonannounce.pm loncommunicate.pm 
                     	londocs.pm lonmeta.pm lonmsg.pm lonsyllabus.pm 
    /loncom/localize	lonlocal.pm 
    /loncom/localize/localize	ja.pm pt.pm 
    /loncom/publisher	lonpubdir.pm 
    /loncom/xml	lonxml.pm 
  Log:
  Internationalization, and in particular, lonlocal:locallocaltime and
  Japanese dates.
  
  
--www1065300580
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20031004164940.txt"

Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.17 loncom/interface/lonaboutme.pm:1.18
--- loncom/interface/lonaboutme.pm:1.17	Sun Sep 21 17:40:06 2003
+++ loncom/interface/lonaboutme.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.17 2003/09/21 21:40:06 www Exp $
+# $Id: lonaboutme.pm,v 1.18 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -129,8 +129,8 @@
 # ---------------------------------------------------------------- Get syllabus
     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
        my $lastmod=$syllabus{'uploaded.lastmodified'};
-       $lastmod=($lastmod?localtime($lastmod):'never');
-       $r->print('Last updated: '.$lastmod);
+       $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
+       $r->print(&mt('Last updated').': '.$lastmod);
        if ($syllabus{'uploaded.photourl'}) {
 	   $r->print('<img src="'.
              &Apache::lonnet::tokenwrapper($syllabus{'uploaded.photourl'}).
@@ -139,7 +139,7 @@
        if ($allowed) {
            $r->print(
 	 '<form method="post" enctype="multipart/form-data">'.
-         '<h3>Upload a Photo</h3>'.
+         '<h3>'.&mt('Upload a Photo').'</h3>'.
          '<input type="file" name="uploaddoc" size="50">'.
          '<input type="submit" name="storeupl" value="Upload">'.
 	 '</form><form method="post">');
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.21 loncom/interface/lonannounce.pm:1.22
--- loncom/interface/lonannounce.pm:1.21	Mon Sep 29 09:38:43 2003
+++ loncom/interface/lonannounce.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.21 2003/09/29 13:38:43 www Exp $
+# $Id: lonannounce.pm,v 1.22 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -84,7 +84,7 @@
 	    my ($courseid,$start,$end,@msg)=split(/\@/,$_);
             my $msg=join('@',@msg);
             my $fullmsg=$ENV{'course.'.$courseid.'.description'}.
-		', '.localtime($start).' - '.localtime($end).': '.$msg;
+		', '.&Apache::lonlocal::locallocaltime($start).' - '.&Apache::lonlocal::locallocaltime($end).': '.$msg;
             if ($courseid eq $ENV{'request.course.id'}) {
               if ((&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))
                && (!$showedcheck{$start.'_'.$end})
Index: loncom/interface/loncommunicate.pm
diff -u loncom/interface/loncommunicate.pm:1.16 loncom/interface/loncommunicate.pm:1.17
--- loncom/interface/loncommunicate.pm:1.16	Mon Sep 22 20:26:10 2003
+++ loncom/interface/loncommunicate.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Communicate
 #
-# $Id: loncommunicate.pm,v 1.16 2003/09/23 00:26:10 www Exp $
+# $Id: loncommunicate.pm,v 1.17 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -112,7 +112,7 @@
         my ($sendtime,$shortsubj,$fromname,$fromdom,$status)=
 	    &Apache::lonmsg::unpackmsgid($_);
        if (defined($sendtime) && $sendtime!~/error/) {
-        $sendtime = localtime($sendtime);
+        $sendtime = &Apache::lonlocal::locallocaltime($sendtime);
         if ($status eq 'new') {
             push @newmsgs, { 
                 msgid    => $_,
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.84 loncom/interface/londocs.pm:1.85
--- loncom/interface/londocs.pm:1.84	Sat Sep 27 20:14:25 2003
+++ loncom/interface/londocs.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.84 2003/09/28 00:14:25 www Exp $
+# $Id: londocs.pm,v 1.85 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -395,7 +395,7 @@
 	) { 
             $foldertitle=&Apache::lontexconvert::msgtexconverted($4);
             $renametitle=$4;
-            $title='<i>'.localtime($1).'</i> '.
+            $title='<i>'.&Apache::lonlocal::locallocaltime($1).'</i> '.
                 &Apache::loncommon::plainname($2,$3).': <br>'.
 		$foldertitle;
 	}
@@ -594,13 +594,13 @@
        }
        my $starttime=time-$ENV{'form.timerange'};
        if ($ENV{'form.timerange'}==2592000) {
-           $seltext=&mt('during the last month').' ('.localtime($starttime).')';
+           $seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
            $monthsel='selected';
        } elsif ($ENV{'form.timerange'}==604800) {
-           $seltext=&mt('during the last week').' ('.localtime($starttime).')';
+           $seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
            $weeksel='selected';
        } elsif ($ENV{'form.timerange'}==86400) {
-           $seltext=&mt('since yesterday').' ('.localtime($starttime).')';
+           $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')';
            $daysel='selected';
        }
        my %lt=&Apache::lonlocal::texthash
@@ -638,7 +638,7 @@
              $r->print(
                  '<tr><td><a href="'.$linkurl.'" target="cat">'.$linkurl.
                  '</a></td><td>'.
-                 localtime($changes{$_}).'</td><td>'.$currentversion.'</td>'.
+                 &Apache::lonlocal::locallocaltime($changes{$_}).'</td><td>'.$currentversion.'</td>'.
 		       '<td>');
              my $lastold=1;
              for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) {
@@ -651,8 +651,8 @@
             for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) {
                  my $url=$root.'.'.$prevvers.'.'.$extension;
                  $r->print('<a href="'.&Apache::lonnet::clutter($url).
-                   '">Version '.$prevvers.' ('.
-                 localtime(&Apache::lonnet::metadata($url,'lastrevisiondate')).
+                   '">'.&mt('Version').' '.$prevvers.' ('.
+                 &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($url,'lastrevisiondate')).
                  ')</a>');
                  if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') {
                     $r->print(' <a href="/adm/diff?filename='.
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.37 loncom/interface/lonmeta.pm:1.38
--- loncom/interface/lonmeta.pm:1.37	Sat Sep 27 09:20:46 2003
+++ loncom/interface/lonmeta.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.37 2003/09/27 13:20:46 www Exp $
+# $Id: lonmeta.pm,v 1.38 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -219,9 +219,9 @@
 
 # --------------------------------------------------------------- Render Output
   my ($thisversion)=($uri=~/\.(\d+)\.(\w+)\.meta$/);
-my $creationdate=localtime(
+my $creationdate=&Apache::lonlocal::locallocaltime(
  &Apache::loncommon::unsqltime($content{'creationdate'}));
-my $lastrevisiondate=localtime(
+my $lastrevisiondate=&Apache::lonlocal::locallocaltime(
  &Apache::loncommon::unsqltime($content{'lastrevisiondate'}));
 my $language=&Apache::loncommon::languagedescription($content{'language'});
 my $mime=&Apache::loncommon::filedescription($content{'mime'}); 
@@ -234,8 +234,8 @@
 $owner=~s/(\w+)(\:|\@)(\w+)/&authordisplay($1,$3)/gse;
 my $versiondisplay='';
 if ($thisversion) {
-    $versiondisplay='Version: '.$thisversion.
-    ' (most recent version: '.$currentversion.')';
+    $versiondisplay=&mt('Version').': '.$thisversion.
+    ' ('.&mt('most recent version').': '.$currentversion.')';
 } else {
     $versiondisplay='Version: '.$currentversion;
 }
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.65 loncom/interface/lonmsg.pm:1.66
--- loncom/interface/lonmsg.pm:1.65	Fri Aug 29 16:38:12 2003
+++ loncom/interface/lonmsg.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.65 2003/08/29 20:38:12 www Exp $
+# $Id: lonmsg.pm,v 1.66 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -737,7 +737,7 @@
 	    $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>'.
-		      '<td>'.localtime($sendtime).'</td><td>'.
+		      '<td>'.&Apache::lonlocal::locallocaltime($sendtime).'</td><td>'.
 		      $fromname.'</td><td>'.$fromdomain.'</td><td>'.
 		      &Apache::lonnet::unescape($shortsubj).'</td><td>'.
                       $status.'</td></tr>');
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.24 loncom/interface/lonsyllabus.pm:1.25
--- loncom/interface/lonsyllabus.pm:1.24	Sun Sep 21 17:40:06 2003
+++ loncom/interface/lonsyllabus.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.24 2003/09/21 21:40:06 www Exp $
+# $Id: lonsyllabus.pm,v 1.25 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -176,14 +176,14 @@
 # ---------------------------------------------------------------- Get syllabus
     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
        my $lastmod=$syllabus{'uploaded.lastmodified'};
-       $lastmod=($lastmod?localtime($lastmod):'never');
+       $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
 
        $r->print('<table><tr><td>'.&mt('Uploaded').':</td><td>'.
  &Apache::loncommon::aboutmewrapper(
  &Apache::loncommon::plainname($syllabus{'uploaded.name'},
                      $syllabus{'uploaded.domain'}),$syllabus{'uploaded.name'},
                      $syllabus{'uploaded.domain'}).
- '</td></tr><tr><td>Last updated:</td><td>'.
+ '</td></tr><tr><td>'.&mt('Last updated').':</td><td>'.
                      $lastmod.
                      '</td></tr></table><p>');
        if ($allowed) {
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.18 loncom/localize/lonlocal.pm:1.19
--- loncom/localize/lonlocal.pm:1.18	Sat Oct  4 14:13:36 2003
+++ loncom/localize/lonlocal.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Localization routines
 #
-# $Id: lonlocal.pm,v 1.18 2003/10/04 18:13:36 www Exp $
+# $Id: lonlocal.pm,v 1.19 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -303,15 +303,16 @@
 	}
 	$year+=1900;
 	my $twelve=$twentyfour;
+	my $ampm;
 	if ($twelve>12) {
 	    $twelve-=12;
-	    $twelve.=$lh->maketext('date_pm');
+	    $ampm=$lh->maketext('date_pm');
 	} else {
-	    $twelve.=$lh->maketext('date_am');
+	    $ampm=$lh->maketext('date_am');
 	}
 	foreach 
 	('seconds','minutes','twentyfour','twelve','day','year',
-	 'month','weekday') {
+	 'month','weekday','ampm') {
 	    $format=~s/\$$_/eval('$'.$_)/gse;
 	}
 	return $format;
Index: loncom/localize/localize/ja.pm
diff -u loncom/localize/localize/ja.pm:1.7 loncom/localize/localize/ja.pm:1.8
--- loncom/localize/localize/ja.pm:1.7	Sun Sep 28 06:31:10 2003
+++ loncom/localize/localize/ja.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Japanese Localization Lexicon
 #
-# $Id: ja.pm,v 1.7 2003/09/28 10:31:10 minoru Exp $
+# $Id: ja.pm,v 1.8 2003/10/04 20:49:40 www Exp $
 #
 # Copyright i-Learning Limited Partnership Company
 #
@@ -34,7 +34,14 @@
 %Lexicon=('_AUTO' => 1,
 'language_code' => 'ja',
 'char_encoding' => 'UTF-8',
-'lang_locale'   => 'japanese',
+'date_locale'  => 
+      '$weekday, $day.$month.$year, $twentyfour:$minutes:$seconds',
+'date_months'  => '1,2,3,4,5,6,7,8,9,10,11,12',
+'date_days'    => '日,月,火,水,木,金,土',
+'date_am' => 'am',
+'date_pm' => 'pm',
+
+
 
    'Domain'
 => 'ドメイン',
Index: loncom/localize/localize/pt.pm
diff -u loncom/localize/localize/pt.pm:1.7 loncom/localize/localize/pt.pm:1.8
--- loncom/localize/localize/pt.pm:1.7	Fri Sep 26 17:04:26 2003
+++ loncom/localize/localize/pt.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Portuguese Localization Lexicon
 #
-# $Id: pt.pm,v 1.7 2003/09/26 21:04:26 www Exp $
+# $Id: pt.pm,v 1.8 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,6 +36,13 @@
           
 'char_encoding'=> 'ISO-8859-1',
 'language_code'=> 'pt',
+'date_locale'  => 
+      '$weekday, $day. $month $year, $twentyfour:$minutes:$seconds Uhr',
+'date_months'  => 'Jan,Febr,Mar,April,Mai,Juni,Juli,Aug,Sept,Okt,Nov,Dez',
+'date_days'    => 'So,Mo,Di,Mi,Do,Fr,Sa',
+'date_am' => 'vormittags',
+'date_pm' => 'nachmittags',
+
 
    'aboutlon.gif'
 => 'aboutlon_pt.gif',
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.41 loncom/publisher/lonpubdir.pm:1.42
--- loncom/publisher/lonpubdir.pm:1.41	Mon Sep 29 12:09:20 2003
+++ loncom/publisher/lonpubdir.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.41 2003/09/29 16:09:20 www Exp $
+# $Id: lonpubdir.pm,v 1.42 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -282,7 +282,7 @@
 		  $disfilename.'</a></td>'.
 		        '<td>&nbsp;</td>'.
 		  '<td>&nbsp;</td>'.
-		  '<td>'.localtime($modtime).'</td>'.
+		  '<td>'.&Apache::lonlocal::locallocaltime($modtime).'</td>'.
 		  "</tr>\n");
     }	
     return OK;
@@ -346,7 +346,7 @@
 	      '</td>'.
 	      '<td>'.$title.'</td>'.
 	      '<td>'.$status.'</td>'.
-	      '<td>'.localtime($cmtime).'</td>'.
+	      '<td>'.&Apache::lonlocal::locallocaltime($cmtime).'</td>'.
 	      "</tr>\n");
     return OK;
 }
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.283 loncom/xml/lonxml.pm:1.284
--- loncom/xml/lonxml.pm:1.283	Thu Oct  2 01:45:38 2003
+++ loncom/xml/lonxml.pm	Sat Oct  4 16:49:40 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.283 2003/10/02 05:45:38 albertel Exp $
+# $Id: lonxml.pm,v 1.284 2003/10/04 20:49:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -280,13 +280,13 @@
         my %idhash=&Apache::lonnet::idrget($tudom,($tuname));
 	return 
  '<img align="right" src="/cgi-bin/barcode.png?encode='.$token.'" />'.
-               'Checked out for '.$plainname.
-               '<br />User: '.$tuname.' at '.$tudom.
-	       '<br />ID: '.$idhash{$tuname}.
-	       '<br />CourseID: '.$tcrsid.
-	       '<br />Course: '.$ENV{'course.'.$tcrsid.'.description'}.
-               '<br />DocID: '.$token.
-               '<br />Time: '.localtime().'<hr />';
+               &mt('Checked out for').' '.$plainname.
+               '<br />'.&mt('User').': '.$tuname.' at '.$tudom.
+	       '<br />'.&mt('ID').': '.$idhash{$tuname}.
+	       '<br />'.&mt('CourseID').': '.$tcrsid.
+	       '<br />'.&mt('Course').': '.$ENV{'course.'.$tcrsid.'.description'}.
+               '<br />'.&mt('DocID').': '.$token.
+               '<br />'.&mt('Time').': '.&Apache::lonlocal::locallocaltime().'<hr />';
     } else {
         return $token;
     }
@@ -1196,7 +1196,8 @@
     unless ($ENV{'request.state'} eq 'published') {
 	if (($ENV{'form.savethisfile'}) || ($ENV{'form.attemptclean'})) {
 	    if (&storefile($file,$ENV{'form.filecont'})) {
-		$request->print("<font COLOR=\"#0000FF\">Updated: ". strftime("%d %b %H:%M:%S",localtime())." </font>");
+		$request->print("<font COLOR=\"#0000FF\">".&mt('Updated').": ".
+&Apache::lonlocal::locallocaltime(time)." </font>");
 	    } 
 	}
     }
@@ -1204,13 +1205,15 @@
     my $result = '';
     my $filecontents=&Apache::lonnet::getfile($file);
     if ($filecontents eq -1) {
+	my $bodytag=&Apache::loncommon::bodytag('File Error');
+	my $fnf=&mt('File not found');
 	$result=(<<ENDNOTFOUND);
 <html>
 <head>
-<title>File not found</title>
+<title>$fnf</title>
 </head>
-<body bgcolor="#FFFFFF">
-<b>File not found: $file</b>
+$bodytag
+<b>$fnf: $file</b>
 </body>
 </html>
 ENDNOTFOUND

--www1065300580--