[LON-CAPA-cvs] cvs: loncom /interface londropadd.pm /localize/localize newphrases.txt

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 06 Nov 2003 20:04:07 -0000


This is a MIME encoded message

--matthew1068149047
Content-Type: text/plain

matthew		Thu Nov  6 15:04:07 2003 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/interface	londropadd.pm 
  Log:
  First stab a localization of londropadd.pm.
  Note: Using parameters in localization.  Let me know if this is okay.
  Also needed to add comments to newphrases.txt.  Again, let me know.
  
  
--matthew1068149047
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20031106150407.txt"

Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.16 loncom/localize/localize/newphrases.txt:1.17
--- loncom/localize/localize/newphrases.txt:1.16	Tue Nov  4 11:33:10 2003
+++ loncom/localize/localize/newphrases.txt	Thu Nov  6 15:04:06 2003
@@ -1,3 +1,37 @@
+LON-CAPA Enrollment Manager
+Upload a class list
+Enroll a single student
+Modify student data
+View Class List
+Drop Students
+Uploading Class List
+Identify fields
+Total number of records found in file: [_1].
+Ignore First Line
+Error
+Invalid home server specified
+Unable to enroll students
+No Kerberos domain was specified.
+Enrolling Students
+# Do not translate this line.  [_1] is username, [_2] - [_5] are first, middle, and last names, and generation.
+<b>[_1]</b>: Unacceptable username for user [_2] [_3] [_4] [_5]
+# Do not translate this line.  [_1] is username, [_2] is error message
+<b>[_1]</b>:  Unable to enroll: [_2]
+# Do not translate this line.  [_1] is a username
+<b>[_1]</b>: Unable to enroll.  No password specified.
+# Do not translate this line.  [_1] is the number of students processed
+Processed [_1] student(s).
+If active, the new role will be available when the students next log in to LON-CAPA.
+Dropping Students
+There are no students currently enrolled.
+# Do not translate this line.  [_1] is username@domain
+Dropped [_1]
+# Do not translate this line.  [_1] is username@domain [_2] is the error message.
+Error dropping [_1]:[_2]
+# Do not translate this line.  [_1] is the number of students processed
+Dropped [_1] student(s).
+Re-enrollment will re-activate data.
+
 You must choose at least one student to continue.
 No changes were made to the current settings.
 Finish Course Initialization
@@ -5,4 +39,4 @@
 Scantron Operator
 Grant/revoke role of Scantron Operator
 Upload Scantron data
-None Found
\ No newline at end of file
+None Found
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.87 loncom/interface/londropadd.pm:1.88
--- loncom/interface/londropadd.pm:1.87	Wed Nov  5 15:55:59 2003
+++ loncom/interface/londropadd.pm	Thu Nov  6 15:04:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.87 2003/11/05 20:55:59 matthew Exp $
+# $Id: londropadd.pm,v 1.88 2003/11/06 20:04:06 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -48,10 +48,11 @@
 ###############################################################
 sub header {
     my $bodytag=&Apache::loncommon::bodytag('Enrollment Manager');
+    my $title = &mt('LON-CAPA Enrollment Manager');
     return(<<ENDHEAD);
 <html>
 <head>
-<title>LON-CAPA Enrollment Manager</title>
+<title>$title</title>
 </head>
 $bodytag
 <form method="post" enctype="multipart/form-data"  
@@ -140,26 +141,33 @@
 #  Menu Phase One
 sub print_main_menu {
     my $r=shift;
+    my %Text = &Apache::lonlocal::texthash
+        ('upload'    => 'Upload a class list',
+         'enrollone' => 'Enroll a single student',
+         'modify'    => 'Modify student data',
+         'view'      => 'View Class List',
+         'drop'      => 'Drop Students');
+
     $r->print(<<END);
 <p>
 <font size="+1">
-    <a href="/adm/dropadd?action=upload">Upload a course list</a>
+    <a href="/adm/dropadd?action=upload">$Text{'upload'}</a>
 </font>
 </p><p>
 <font size="+1">
-    <a href="/adm/dropadd?action=enrollstudent">Enroll a single student</a>
+    <a href="/adm/dropadd?action=enrollstudent">$Text{'enrollone'}</a>
 </font>
 </p><p>
 <font size="+1">
-    <a href="/adm/dropadd?action=modifystudent">Modify student data</a>
+    <a href="/adm/dropadd?action=modifystudent">$Text{'modify'}</a>
 </font>
 </p><p>
 <font size="+1">
-    <a href="/adm/dropadd?action=classlist">View Class List</a>
+    <a href="/adm/dropadd?action=classlist">$Text{'view'}</a>
 </font>
 </p><p>
 <font size="+1">
-    <a href="/adm/dropadd?action=drop">Drop Students</a>
+    <a href="/adm/dropadd?action=drop">$Text{'drop'}</a>
 </font>
 </p>
 END
@@ -187,11 +195,14 @@
     }
     my $javascript_validations=&javascript_validations($krbdefdom);
     my $checked=(($ENV{'form.noFirstLine'})?' checked="1"':'');
+    $r->print('<h3>'.&mt('Uploading Class List')."</h3>\n".
+              "<hr>\n".
+              '<h3>'.&mt('Identify fields')."</h3>\n");
+    $r->print("<p>\n".
+              &mt('Total number of records found in file: [_1].',$distotal).
+              "\n".
+              "</p><hr>\n");
     $r->print(<<ENDPICK);
-<h3>Uploading Class List</h3>
-<hr>
-<h3>Identify fields</h3>
-Total number of records found in file: $distotal <hr />
 Enter as many fields as you can. The system will inform you and bring you back
 to this page if the data selected is insufficient to run your class.<hr />
 <input type="button" value="Reverse Association" onClick="javascript:this.form.associate.value='Reverse Association';submit(this.form);" />
@@ -474,8 +485,8 @@
     my $date_table = &date_setting_table();
     $r->print(<<ENDPICK);
 </table>
-<input type=hidden name=nfields value=$i>
-<input type=hidden name=keyfields value="$keyfields">
+<input type="hidden" name="nfields" value="$i">
+<input type="hidden" name="keyfields" value="$keyfields">
 <h3>Login Type</h3>
 <p>Note: this will not take effect if the user already exists</p>
 <p>
@@ -1521,27 +1532,25 @@
 #
 sub print_first_courselist_upload_form {
     my $r=shift;
-    my $upfile_select=&Apache::loncommon::upfile_select_html();
-    my $create_classlist_help = 
-	&Apache::loncommon::help_open_topic("Course_Create_Class_List",
-           "How do I create a class list from a spreadsheet");
-    my $create_csv_help =
-	&Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
-           "How do I create a CSV file from a spreadsheet");
-    $r->print(<<ENDUPFORM);
-<input type=hidden name=phase value=two>
-<h3>Upload a courselist</h3>
-$upfile_select
-<p>
-<input type=submit name="fileupload" value="Upload Courselist">
-<input type="hidden" name="action" value="upload" />
-<input type="hidden" name="state"  value="got_file" />
-<input type="checkbox" name="noFirstLine" /> Ignore First Line<br />
-</p>
-$create_classlist_help <br />
-$create_csv_help
-</body></html>
-ENDUPFORM
+    my $str;
+    $str  = '<input type="hidden" name="phase" value="two">';
+    $str .= '<input type="hidden" name="action" value="upload" />';
+    $str .= '<input type="hidden"   name="state"  value="got_file" />';
+    $str .= "<h3>".&mt('Upload a class list')."</h3>\n";
+    $str .= &Apache::loncommon::upfile_select_html();
+    $str .= "<p>\n";
+    $str .= '<input type="submit" name="fileupload" value="'.
+        &mt('Upload class list').'">'."\n";
+    $str .= '<input type="checkbox" name="noFirstLine" /> '.
+        &mt('Ignore First Line')."</p>\n";
+    $str .= &Apache::loncommon::help_open_topic("Course_Create_Class_List",
+                         "How do I create a class list from a spreadsheet").
+                             "<br />\n";
+    $str .= &Apache::loncommon::help_open_topic("Course_Convert_To_CSV",
+                           "How do I create a CSV file from a spreadsheet").
+                               "<br />\n";
+    $str .= "</body>\n</html>\n";
+    $r->print($str);
     return;
 }
 
@@ -1576,8 +1585,9 @@
     } else {
         my %home_servers = &Apache::loncommon::get_library_servers($domain);
         if (! exists($home_servers{$desiredhost})) {
-            $r->print('<font color="#ff0000">Error:</font>'.
-                      'Invalid home server specified');
+            $r->print('<font color="#ff0000">'.&mt('Error').'</font>'.
+                      &mt('Invalid home server specified'));
+            $r->print("</body>\n</html>\n");
             return;
         }
     }
@@ -1602,8 +1612,8 @@
     if ($amode =~ /^krb/) {
         if (! defined($genpwd) || $genpwd eq '') {
             $r->print('<font color="red" size="+1">'.
-                      'Unable to enroll students:'.'</font>  '.
-                      'No Kerberos domain was specified.</p>');
+                      &mt('Unable to enroll students').'</font>  '.
+                      &mt('No Kerberos domain was specified.').'</p>');
             $amode = ''; # This causes the loop below to be skipped
         }
     }
@@ -1611,7 +1621,7 @@
         #######################################
         ##         Enroll Students           ##
         #######################################
-        $r->print('<h3>Enrolling Students</h3>'."\n".'<p>');
+        $r->print('<h3>'.&mt('Enrolling Students')."</h3>\n<p>\n");
         my $count=0;
         my $flushc=0;
         my %student=();
@@ -1640,9 +1650,10 @@
                     }
                 }
                 if ($entries{$fields{'username'}}=~/\W/) {
-                    $r->print('<br /><b>Unacceptable username: '.
-                              $entries{$fields{'username'}}.' for user '.
-                              $fname.' '.$mname.' '.$lname.' '.$gen.'</b>');
+                    $r->print('<br />'.
+      &mt('<b>[_1]</b>: Unacceptable username for user [_2] [_3] [_4] [_5]',
+          $entries{$fields{'username'}},$fname,$mname,$lname,$gen).
+                              '</b>');
                 } else {
                     # determine section number
                     my $sec='';
@@ -1696,8 +1707,8 @@
                              $email);
                         if ($reply ne 'ok') {
                             $reply =~ s/^error://;
-                            $r->print('<br /><b>'.$username.'</b>:'.
-                                      '  Unable to enroll: '.$reply);
+                            $r->print('<br />'.
+                &mt('<b>[_1]</b>:  Unable to enroll: [_2]',$username,$reply));
          		} else {
                             $count++; $flushc++;
                             $student{$username}=1;
@@ -1708,24 +1719,28 @@
                             }
                         }
                     } else {
-                        $r->print('<br /><b>'.$username.'</b>:'.
-                           '  Unable to enroll: No password specified.');
+                        $r->print('<br />'.
+      &mt('<b>[_1]</b>: Unable to enroll.  No password specified.',$username)
+                                  );
                     }
                 }
             }
         } # end of foreach (@studentdata)
-        $r->print('</p><p>Processed Students: '.$count.'</p>');
-        $r->print("<p>If active, the new role will be available when the ".
-                  "students next log in to LON-CAPA.</p>");
+        $r->print("</p>\n<p>\n".&mt('Processed [_1] student(s).',$count).
+                  "</p>\n");
+        $r->print("<p>\n".
+                  &mt('If active, the new role will be available when the '.
+                  'students next log in to LON-CAPA.')."</p>\n");
         #####################################
         #           Drop students           #
         #####################################
         if ($ENV{'form.fullup'} eq 'yes') {
-            $r->print('<h3>Dropping Students</h3>');
+            $r->print('<h3>'.&mt('Dropping Students')."</h3>\n");
             #  Get current classlist
             my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
             if (! defined($classlist)) {
-                $r->print("There are no students currently enrolled.\n");
+                $r->print(&mt('There are no students currently enrolled.').
+                          "\n");
             } else {
                 # Remove the students we just added from the list of students.
                 foreach (@studentdata) {
@@ -1758,15 +1773,16 @@
         # drop student
         my $result = &modifystudent($udom,$uname,$ENV{'request.course.id'});
         if ($result eq 'ok' || $result eq 'ok:') {
-            $r->print('Dropped '.$uname.' @ '.$udom.'<br>');
+            $r->print(&mt('Dropped [_1]',$uname.'@'.$udom).'<br>');
             $count++;
         } else {
-            $r->print('Error dropping '.$uname.' @ '.$udom.': '.$result.
+            $r->print(
+          &mt('Error dropping [_1]:[_2]',$uname.'@'.$udom,$result).
                       '<br />');
         }
     }
-    $r->print('<p><b>Dropped '.$count.' student(s).</b>');
-    $r->print('<p>Re-enrollment will re-activate data.') if ($count);
+    $r->print('<p><b>'.&mt('Dropped [_1] student(s).',$count).'</b></p>');
+    $r->print('<p>'.&mt('Re-enrollment will re-activate data.')) if ($count);
 }
 
 ###################################################################

--matthew1068149047--