[LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm /interface/statistics lonproblemstatistics.pm /localize/localize newphrases.txt

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 29 Sep 2003 16:20:18 -0000


matthew		Mon Sep 29 12:20:18 2003 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/interface/statistics	lonproblemstatistics.pm 
    /loncom/interface	lonstatistics.pm 
  Log:
  Localization of lonproblemstatistics.pm.
  
  
Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.6 loncom/localize/localize/newphrases.txt:1.7
--- loncom/localize/localize/newphrases.txt:1.6	Mon Sep 29 10:42:24 2003
+++ loncom/localize/localize/newphrases.txt	Mon Sep 29 12:20:18 2003
@@ -3,3 +3,27 @@
 Update Display
 All versions
 No role specified
+part
+Sequence or Folder
+#Stdnts
+Max Tries
+Mean Tries
+S.D. tries
+Skew Tries
+DoDiff
+#YES
+num_override
+%Wrng
+Sections
+Enrollment Status
+Sequences and Folders
+Output
+problem statistics grouped by sequence
+problem statistics ungrouped
+problem statistics, Excel
+Generate Statistics
+Clear Caches
+Preparing Excel Spreadsheet
+Your Excel Spreadsheet
+Problems creating new Excel file.  This error has been logged.  Please alert your LON-CAPA administrator.
+
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.58 loncom/interface/statistics/lonproblemstatistics.pm:1.59
--- loncom/interface/statistics/lonproblemstatistics.pm:1.58	Wed Sep  3 12:07:06 2003
+++ loncom/interface/statistics/lonproblemstatistics.pm	Mon Sep 29 12:20:18 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.58 2003/09/03 16:07:06 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.59 2003/09/29 16:20:18 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -54,8 +54,16 @@
 use Apache::lonhtmlcommon;
 use Apache::loncoursedata;
 use Apache::lonstatistics;
+use Apache::lonlocal;
 use Spreadsheet::WriteExcel;
 
+##
+## Localization notes:
+##
+## in @Fields[0]->{'long_title'} is placed in Excel files and is used as the
+## header for plots created with Graph.pm, both of which more than likely do
+## not support localization.
+##
 my @Fields = (
            { name => 'problem_num',
              title => 'P#',
@@ -201,10 +209,10 @@
     my $Str = '';
     $Str .= '<table cellspacing="5">'."\n";
     $Str .= '<tr>';
-    $Str .= '<td align="center"><b>Sections</b></td>';
-    $Str .= '<td align="center"><b>Enrollment Status</b></td>';
-    $Str .= '<td align="center"><b>Sequences and Folders</b></td>';
-    $Str .= '<td align="center"><b>Output</b></td>';
+    $Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>';
+    $Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>';
+    $Str .= '<td align="center"><b>'.&mt('Sequences and Folders').'</b></td>';
+    $Str .= '<td align="center"><b>'.&mt('Output').'</b></td>';
     $Str .= '</tr>'."\n";
     #
     $Str .= '<tr><td align="center">'."\n";
@@ -232,9 +240,11 @@
     $Str .= $html;
     $Str .= '</td></tr>'."\n";
     $Str .= '</table>'."\n";
-    $Str .= '<input type="submit" value="Generate Statistics" />';
+    $Str .= '<input type="submit" name="GenerateStatistics" value="'.
+        &mt('Generate Statistics').'" />';
     $Str .= '&nbsp;'x5;
-    $Str .= '<input type="submit" name="ClearCache" value="Clear Caches" />';
+    $Str .= '<input type="submit" name="ClearCache" value="'.
+        &mt('Clear Caches').'" />';
     $Str .= '&nbsp;'x5;
     return ($Str,$outputmode,$show);
 }
@@ -280,10 +290,10 @@
             &output_html_ungrouped($r);
         }
     } elsif ($output_mode eq 'excel') {
-        $r->print("<h2>Preparing Excel Spreadsheet</h2>");
+        $r->print('<h2>'.&mt('Preparing Excel Spreadsheet').'</h2>');
         &output_excel($r);
     } else {
-        $r->print("<h1>Not implemented</h1>");
+        $r->print('<h1>'.&mt('Not implemented').'</h1>');
     }
     return;
 }
@@ -490,9 +500,9 @@
     # Check for errors
     if (! defined($excel_workbook)) {
         $r->log_error("Error creating excel spreadsheet $filename: $!");
-        $r->print("Problems creating new Excel file.  ".
+        $r->print(&mt("Problems creating new Excel file.  ".
                   "This error has been logged.  ".
-                  "Please alert your LON-CAPA administrator");
+                  "Please alert your LON-CAPA administrator."));
         return ;
     }
     #
@@ -556,6 +566,8 @@
     # Brief headers
     foreach my $field (@Fields) {
         next if ($field->{'name'} eq 'problem_num');
+        # Use english for excel as I am not sure how well excel handles 
+        # other character sets....
         $excel_sheet->write($rows_output,$cols_output++,$field->{'title'});
     }
     $rows_output++;
@@ -589,7 +601,8 @@
     $excel_workbook->close();
     # Tell the user where to get their excel file
     $r->print('<br />'.
-              '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");
+              '<a href="'.$filename.'">'.
+              &mt('Your Excel Spreadsheet').'</a>'."\n");
     $r->rflush();
     return;
 }
@@ -645,7 +658,7 @@
                 'document.Statistics.sortby.value='."'".$field->{'name'}."'".
                     ';document.Statistics.submit();">';
         }
-        $header_row .= $field->{'title'};
+        $header_row .= &mt($field->{'title'});
         if ($options =~ /sortable/) {
             $header_row.= '</a>';
         }
@@ -656,7 +669,7 @@
             $header_row .= '<a href="javascript:'.
                 "document.Statistics.plot.value='$field->{'name'}'".
                     ';document.Statistics.submit();">';
-            $header_row .= 'plot</a>)';
+            $header_row .= &mt('plot').'</a>)';
         }
         $header_row .= '</th>';
     }
@@ -807,6 +820,8 @@
 =pod 
 
 =item &ProblemStatisticsLegend()
+
+HELP  This needs to be localized, or at least generated automatically.
 
 =cut
 
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.80 loncom/interface/lonstatistics.pm:1.81
--- loncom/interface/lonstatistics.pm:1.80	Fri Aug 29 17:11:25 2003
+++ loncom/interface/lonstatistics.pm	Mon Sep 29 12:20:18 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.80 2003/08/29 21:11:25 matthew Exp $
+# $Id: lonstatistics.pm,v 1.81 2003/09/29 16:20:18 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -83,6 +83,7 @@
 use Apache::lonstudentassessment();
 use Apache::lonpercentage;
 use Apache::lonmysql;
+use Apache::lonlocal;
 use Time::HiRes;
 
 #######################################################
@@ -857,7 +858,7 @@
         }
         $Str .= "\n".'    <option value="'.$option->{'value'}.'"';
         $Str .= " selected " if ($option->{'value'} eq $selected);
-        $Str .= ">".$option->{'name'}."<\/option>";
+        $Str .= ">".&mt($option->{'name'})."<\/option>";
     }
     $Str .= "\n</select>";
     return ($Str,$output_mode,$show);