[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 29 Sep 2003 13:49:31 -0000


www		Mon Sep 29 09:49:31 2003 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Internationalize datesetter
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.29 loncom/interface/lonhtmlcommon.pm:1.30
--- loncom/interface/lonhtmlcommon.pm:1.29	Tue Sep  2 21:53:46 2003
+++ loncom/interface/lonhtmlcommon.pm	Mon Sep 29 09:49:31 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.29 2003/09/03 01:53:46 www Exp $
+# $Id: lonhtmlcommon.pm,v 1.30 2003/09/29 13:49:31 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -56,6 +56,7 @@
 package Apache::lonhtmlcommon;
 
 use Time::Local;
+use Apache::lonlocal;
 use strict;
 
 
@@ -202,7 +203,7 @@
     for(my $m = 1;$m <=$#Months;$m++) {
         $result .= "      <option value=\"$m\" ";
         $result .= "selected " if ($m-1 == $month);
-        $result .= "> $Months[$m] </option>\n";
+        $result .= "> ".&mt($Months[$m])." </option>\n";
     }
     $result .= "  </select>\n";
     $result .= "  <input type=\"text\" name=\"$dname\_day\" ".
@@ -217,23 +218,26 @@
         $result .= "      <option value=\"$h\" ";
         $result .= "selected " if ($hour == $h);
         $result .= "> ";
+	my $timest='';
         if ($h == 0) {
-            $result .= "12 am";
+            $timest .= "12 am";
         } elsif($h == 12) {
-            $result .= "12 noon";
+            $timest .= "12 noon";
         } elsif($h < 12) {
-            $result .= "$h am";
+            $timest .= "$h am";
         } else {
-            $result .= $h-12 ." pm";
+            $timest .= $h-12 ." pm";
         }
-        $result .= " </option>\n";
+	$timest=&mt($timest);
+        $result .= $timest." </option>\n";
     } 
     $result .= "  </select>\n";
     $result .= "  <input type=\"text\" name=\"$dname\_minute\" ".$special.' '.
         "value=\"$min\" size=\"3\" /> m\n";
     $result .= "  <input type=\"text\" name=\"$dname\_second\" ".$special.' '.
         "value=\"$sec\" size=\"3\" /> s\n";
-    $result .= "<a href=\"javascript:$dname\_opencalendar()\">Select Date</a></nobr>\n<!-- end $dname date setting form -->\n";
+    $result .= "<a href=\"javascript:$dname\_opencalendar()\">".
+    &mt('Select Date')."</a></nobr>\n<!-- end $dname date setting form -->\n";
     return $result;
 }