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

bisitz bisitz at source.lon-capa.org
Wed Feb 12 11:54:21 EST 2014


bisitz		Wed Feb 12 16:54:21 2014 EDT

  Modified files:              
    /loncom/interface/spreadsheet	Spreadsheet.pm 
  Log:
  - Internationalization: Added missing &mt() calls
  - XHTML
  - Standard styles
  
  
  
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.82 loncom/interface/spreadsheet/Spreadsheet.pm:1.83
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.82	Fri Aug  9 17:58:15 2013
+++ loncom/interface/spreadsheet/Spreadsheet.pm	Wed Feb 12 16:54:21 2014
@@ -1,5 +1,5 @@
 #
-# $Id: Spreadsheet.pm,v 1.82 2013/08/09 17:58:15 raeburn Exp $
+# $Id: Spreadsheet.pm,v 1.83 2014/02/12 16:54:21 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -774,7 +774,7 @@
         $depth++;
         if ($depth>100) {
 	    undef %sheet_values;
-            return $lastcalc.': Maximum calculation depth exceeded';
+            return $lastcalc.': '.&mt('Maximum calculation depth exceeded');
         }
     }
     return 'okay';
@@ -873,7 +873,7 @@
             $returnvalue = $values[0];
         } elsif (scalar(@matches) > 0) {
             # more than one match.  Look for a concise one
-            $returnvalue =  "'non-unique parameter name : $expression'";
+            $returnvalue =  "'".&mt('non-unique parameter name: [_1]',$expression).'"';
             for (my $i=0; $i<=$#matches;$i++) {
                 if ($matches[$i] =~ /^$expression$/) {
                     # why do we not do this lookup here?
@@ -883,7 +883,7 @@
         } else {
             # There was a negative number of matches, which indicates 
             # something is wrong with reality.  Better warn the user.
-            $returnvalue = '"bizzare parameter: '.$expression.'"';
+            $returnvalue = "'".&mt('bizzare parameter: [_1]',$expression)."'";
         }
         return $returnvalue;
     }
@@ -1267,9 +1267,9 @@
     my $self = shift();
     my $Str = '';
     if ($self->badcalc()) {
-        $Str = '<h3 style="color:red">'.
+        $Str = '<p class="LC_error">'.
             &mt('An error occurred while calculating this spreadsheet').
-            "</h3>\n".
+            "</p>\n".
             '<pre>'.$self->calcerror()."</pre>\n";
     }
     return $Str;
@@ -1432,7 +1432,7 @@
     foreach  ($self->output_options()) {
         $output_selector.='<option value="'.$_->{'value'}.'"';
         if ($_->{'value'} eq $default) {
-            $output_selector .= ' selected';
+            $output_selector .= ' selected="selected"';
         }
         $output_selector .= ">".&mt($_->{'description'})."</option>\n";
     }
@@ -1509,7 +1509,7 @@
     #
     # Write a link to allow them to download it
     $r->print('<br />'.
-              '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");
+              '<a href="'.$filename.'">'.&mt('Your Excel spreadsheet').'</a>'."\n");
     return;
 }
 
@@ -1695,8 +1695,10 @@
             my $sheetxml=&Apache::lonnet::getfile
                 (&Apache::lonnet::filelocation('',$filename));
             if ($sheetxml == -1) {
-                $sheetxml='<field row="0" col="A">"Error loading spreadsheet '
-                    .$self->filename().'"</field>';
+                $sheetxml='<field row="0" col="A">'.
+                          &mt('Error loading spreadsheet [_1]',
+                                  '"'.$self->filename().'"').
+                          '</field>';
             }
             ($formulas,undef) = &parse_sheet(\$sheetxml);
             # Get just the filename and set the sheets filename




More information about the LON-CAPA-cvs mailing list