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

www lon-capa-cvs@mail.lon-capa.org
Thu, 09 Oct 2003 01:40:05 -0000


This is a MIME encoded message

--www1065663605
Content-Type: text/plain

www		Wed Oct  8 21:40:05 2003 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Internationalize, at least a lot of it.
  
  
--www1065663605
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20031008214005.txt"

Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.129 loncom/interface/lonparmset.pm:1.130
--- loncom/interface/lonparmset.pm:1.129	Wed Oct  8 19:07:01 2003
+++ loncom/interface/lonparmset.pm	Wed Oct  8 21:40:05 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.129 2003/10/08 23:07:01 www Exp $
+# $Id: lonparmset.pm,v 1.130 2003/10/09 01:40:05 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,7 +61,7 @@
 use GDBM_File;
 use Apache::lonhomework;
 use Apache::lonxml;
-
+use Apache::lonlocal;
 
 my %courseopt;
 my %useropt;
@@ -864,7 +864,7 @@
 	    $message.="<font color=red>Write Error: $1</font>";
 	}
 # ---------------------------------------------------------------- Done storing
-	$message.='<h3>Changes can take up to 10 minutes before being active for all students.'.&Apache::loncommon::help_open_topic('Caching').'</h3>';
+	$message.='<h3>'.&mt('Changes can take up to 10 minutes before being active for all students.').&Apache::loncommon::help_open_topic('Caching').'</h3>';
     }
 # --------------------------------------------- Devalidate cache for this child
     &Apache::lonnet::devalidatecourseresdata(
@@ -923,9 +923,9 @@
 
     $r->print('<h2>'.$message.'</h2><table>');
                         
-    my $submitmessage = 'Update Section or Specific User';
+    my $submitmessage = &mt('Update Section or Specific User');
     if (!$pssymb) {
-        $r->print('<tr><td>Select Parameter Level</td><td colspan="2">');
+        $r->print('<tr><td>'.&mt('Select Parameter Level').'</td><td colspan="2">');
         $r->print('<select name="parmlev">');
         foreach (reverse sort keys %alllevs) {
             $r->print('<option value="'.$alllevs{$_}.'"');
@@ -938,9 +938,9 @@
 
         $r->print('</tr>');
 	if ($parmlev ne 'general') {
-	    $r->print('<tr><td>Select Enclosing Map or Folder</td>');
+	    $r->print('<tr><td>'.&mt('Select Enclosing Map or Folder').'</td>');
 	    $r->print('<td colspan="2"><select name="pschp">');
-	    $r->print('<option value="all">All Maps or Folders</option>');
+	    $r->print('<option value="all">'.&mt('All Maps or Folders').'</option>');
 	    foreach (sort {$allmaps{$a} cmp $allmaps{$b}} keys %allmaps) {
 		$r->print('<option value="'.$_.'"');
 		if (($pschp eq $_)) { $r->print(' selected'); }
@@ -950,7 +950,7 @@
 	}
     } else {
         my ($map,$id,$resource)=&Apache::lonnet::decode_symb($pssymb);
-        $r->print("<tr><td>Specific Resource</td><td>$resource</td>");
+        $r->print("<tr><td>".&mt('Specific Resource')."</td><td>$resource</td>");
         $r->print('<td><input type="submit" name="dis" value="'.$submitmessage.'"></td>');
         $r->print('</tr>');
         $r->print('<input type="hidden" value="'.$pssymb.'" name="symb">');
@@ -958,7 +958,7 @@
 
     $r->print('<tr><td colspan="3"><hr /><input type="checkbox"');
     if ($showoptions eq 'show') {$r->print(" checked ");}
-    $r->print(' name="showoptions" value="show">Show More Options<hr /></td></tr>');
+    $r->print(' name="showoptions" value="show">'.&mt('Show More Options').'<hr /></td></tr>');
 #    $r->print("<tr><td>Show: $showoptions</td></tr>");
 #    $r->print("<tr><td>pscat: @pscat</td></tr>");
 #    $r->print("<tr><td>psprt: @psprt</td></tr>");
@@ -967,12 +967,12 @@
     if ($showoptions eq 'show') {
         my $tempkey;
 
-        $r->print('<tr><td colspan="3" align="center">Select Parameters to View</td></tr>');
+        $r->print('<tr><td colspan="3" align="center">'.&mt('Select Parameters to View').'</td></tr>');
 
         $r->print('<tr><td colspan="2"><table>');
         $r->print('<tr><td><input type="checkbox" name="pscat" value="all"');
         $r->print(' checked') unless (@pscat);
-        $r->print('>All Parameters</td>');
+        $r->print('>'.&mt('All Parameters').'</td>');
 
         my $cnt=0;
         foreach $tempkey (sort { $allparms{$a} cmp $allparms{$b} }
@@ -992,7 +992,7 @@
         $r->print('<td><select multiple name="psprt" size="5">');
         $r->print('<option value="all"');
         $r->print(' selected') unless (@psprt);
-        $r->print('>All Parts</option>');
+        $r->print('>'.&mt('All Parts').'</option>');
         my %temphash=();
         foreach (@psprt) { $temphash{$_}=1; }
         foreach $tempkey (sort keys %allparts) {
@@ -1006,9 +1006,9 @@
         }
         $r->print('</select></td></tr><tr><td colspan="3"><hr /></td></tr>');
 
-        $r->print('<tr><td>Sort list by</td><td>');
+        $r->print('<tr><td>'.&mt('Sort list by').'</td><td>');
         $r->print('<select name="fcat">');
-        $r->print('<option value="">Enclosing Map or Folder</option>');
+        $r->print('<option value="">'.&mt('Enclosing Map or Folder').'</option>');
         foreach (sort keys %allkeys) {
             $r->print('<option value="'.$_.'"');
             if ($fcat eq $_) { $r->print(' selected'); }
@@ -1045,9 +1045,9 @@
     }
     $r->print('</table><br />');
     if (($prevvisit) || ($pschp) || ($pssymb)) {
-        $submitmessage = "Update Course Assessment Parameter Display";
+        $submitmessage = &mt("Update Course Assessment Parameter Display");
     } else {
-        $submitmessage = "Set/Modify Course Assessment Parameters";
+        $submitmessage = &mt("Set/Modify Course Assessment Parameters");
     }
     $r->print('<input type="submit" name="dis" value="'.$submitmessage.'">');
 
@@ -1076,10 +1076,10 @@
            my $coursespan=$csec?8:5;
            $r->print('<p><table border=2>');
            $r->print('<tr><td colspan=5></td>');
-           $r->print('<th colspan='.($coursespan).'>Any User</th>');
+           $r->print('<th colspan='.($coursespan).'>'.&mt('Any User').'</th>');
            if ($uname) {
                $r->print("<th colspan=3 rowspan=2>");
-               $r->print("User $uname at Domain $udom</th>");
+               $r->print(&mt("User")." $uname ".&mt('at Domain')." $udom</th>");
            }
            $r->print(<<ENDTABLETWO);
 <th rowspan=3>Parameter in Effect</th>
@@ -1098,11 +1098,11 @@
 ENDTABLEHEADFOUR
 
            if ($csec) {
-               $r->print('<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>');
+               $r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
            }
 
            if ($uname) {
-               $r->print('<th>general</th><th>for Enclosing Map or Folder</th><th>for Resource</th>');
+               $r->print('<th>'.&mt('general').'</th><th>'.&mt('for Enclosing Map or Folder').'</th><th>'.&mt('for Resource').'</th>');
            }
 
            $r->print('</tr>');
@@ -1277,20 +1277,22 @@
                       ('firstname','middlename','lastname','generation', 'id'));
                     my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
                            .$name{'lastname'}.' '.$name{'generation'};
-                    $r->print("User <i>$uname \($person\) </i> in \n");
+                    $r->print(&mt("User")." <i>$uname \($person\) </i> ".
+                        &mt('in')." \n");
                 } else {
-                    $r->print("<i>all</i> users in \n");
+                    $r->print("<i>".&mt('all').'</i> '.&mt('users in')." \n");
                 }
             
-                if ($csec) {$r->print("Section <i>$csec</i> of \n")};
+                if ($csec) {$r->print(&mt("Section")." <i>$csec</i> ".
+				      &mt('of')." \n")};
 
                 $r->print("<i>$coursename</i><br />");
                 $r->print("</font></h4>\n");
 #---------------------------------------------------------------- print table
                 $r->print('<p><table border="2">');
-                $r->print('<tr><th>Parameter Name</th>');
-                $r->print('<th>Default Value</th>');
-                $r->print('<th>Parameter in Effect</th></tr>');
+                $r->print('<tr><th>'.&mt('Parameter Name').'</th>');
+                $r->print('<th>'.&mt('Default Value').'</th>');
+                $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');
 
 	        foreach (sort keys %name) {
                     &print_row($r,$_,\%part,\%name,$mapid,\%default,
@@ -1356,18 +1358,18 @@
                   ('firstname','middlename','lastname','generation', 'id'));
                 my $person=$name{'firstname'}.' '.$name{'middlename'}.' '
                        .$name{'lastname'}.' '.$name{'generation'};
-                $r->print(" User <i>$uname \($person\) </i> \n");
+                $r->print(" ".&mt("User")." <i>$uname \($person\) </i> \n");
             } else {
-                $r->print("<i>ALL</i> USERS \n");
+                $r->print("<i>".&mt("ALL")."</i> ".&mt("USERS")." \n");
             }
             
-            if ($csec) {$r->print("Section <i>$csec</i>\n")};
+            if ($csec) {$r->print(&mt("Section")." <i>$csec</i>\n")};
             $r->print("</font></h4>\n");
 #---------------------------------------------------------------- print table
             $r->print('<p><table border="2">');
-            $r->print('<tr><th>Parameter Name</th>');
-            $r->print('<th>Default Value</th>');
-            $r->print('<th>Parameter in Effect</th></tr>');
+            $r->print('<tr><th>'.&mt('Parameter Name').'</th>');
+            $r->print('<th>'.&mt('Default Value').'</th>');
+            $r->print('<th>'.&mt('Parameter in Effect').'</th></tr>');
 
 	    foreach (sort keys %name) {
                 &print_row($r,$_,\%part,\%name,$mapid,\%default,
@@ -1423,7 +1425,7 @@
             my $bkuptime=time;
             my @tmp = &Apache::lonnet::get
                 ('environment',['url'],$dom,$crs);
-            $setoutput.='Backing up previous URL: '.
+            $setoutput.=&mt('Backing up previous URL').': '.
                 &Apache::lonnet::put
                 ('environment',
                  {'top level map backup '.$bkuptime => $tmp[1] },
@@ -1462,10 +1464,10 @@
             my $put_result = &Apache::lonnet::put('environment',
                                                   {$name=>$value},$dom,$crs);
             if ($put_result eq 'ok') {
-                $setoutput.='Set <b>'.$name.'</b> to <b>'.$value.'</b>.<br />';
+                $setoutput.=&mt('Set').' <b>'.$name.'</b> '.&mt('to').' <b>'.$value.'</b>.<br />';
             } else {
-                $setoutput.='Unable to set <b>'.$name.'</b> to '.
-                    '<b>'.$value.'</b> due to '.$put_result.'.<br />';
+                $setoutput.=&mt('Unable to set').' <b>'.$name.'</b> '.&mt('to').
+		    ' <b>'.$value.'</b> '.&mt('due to').' '.$put_result.'.<br />';
             }
         }
     }
@@ -1616,7 +1618,7 @@
         my $onchange = 'onFocus="javascript:window.document.forms'.
             '[\'envform\'].elements[\'newp_setparmval\']'.
             '.checked=true;"';
-	$output.='<tr><td><i>Create New Environment Variable</i><br />'.
+	$output.='<tr><td><i>'.&mt('Create New Environment Variable').'</i><br />'.
 	    '<input type="text" size=40 name="newp_name" '.
                 $onchange.' /></td><td>'.
             '<input type="text" size=40 name="newp_value" '.
@@ -1675,7 +1677,8 @@
 	return '';
     } else {
 	$tableopen=1;
-	return '<table border="2"><tr><th>Parameter</th><th>Delete</th><th>Set to ...</th></tr>';
+	return '<table border="2"><tr><th>'.&mt('Parameter').'</th><th>'.
+	    &mt('Delete').'</th><th>'.&mt('Set to ...').'</th></tr>';
     }
 }
 
@@ -1738,17 +1741,17 @@
 	if ($resourcedata{$thiskey.'.type'}) {
 	    my ($course,$middle,$part,$name)=
 		($thiskey=~/^(\w+)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
-	    my $section='All Students';
+	    my $section=&mt('All Students');
 	    if ($middle=~/^\[(.*)\]\./) {
-		$section='Group/Section: '.$1;
+		$section=&mt('Group/Section').': '.$1;
 		$middle=~s/^\[(.*)\]\.//;
 	    }
 	    $middle=~s/\.$//;
-	    my $realm='<font color="red">All Resources</font>';
+	    my $realm='<font color="red">'.&mt('All Resources').'</font>';
 	    if ($middle=~/^(.+)\_\_\_\(all\)$/) {
-		$realm='<font color="green">Folder/Map: '.&Apache::lonnet::gettitle($1).'</font>';
+		$realm='<font color="green">'.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'</font>';
 	    } elsif ($middle) {
-		$realm='<font color="orange">Resource: '.&Apache::lonnet::gettitle($middle).'</font>';
+		$realm='<font color="orange">'.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).'</font>';
 	    }
 	    if ($section ne $oldsection) {
 		$r->print(&tableend()."\n<hr /><h1>$section</h1>");
@@ -1762,7 +1765,7 @@
 	    }
 	    if ($part ne $oldpart) {
 		$r->print(&tableend().
-			  "\n<h3><font color='blue'>Part: $part</font></h3>");
+			  "\n<h3><font color='blue'>".&mt('Part').": $part</font></h3>");
 		$oldpart=$part;
 	    }
 #
@@ -1790,7 +1793,7 @@
     }
     
     $r->print(&tableend().
-	      '<p><input type="submit" value="Modify Parameters" /></p></form></body></html>');
+	      '<p><input type="submit" value="'.&mt('Modify Parameters').'" /></p></form></body></html>');
 }
 
 ##################################################

--www1065663605--