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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 07 Nov 2003 21:04:37 -0000


This is a MIME encoded message

--matthew1068239077
Content-Type: text/plain

matthew		Fri Nov  7 16:04:37 2003 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/interface	londropadd.pm loncommon.pm 
  Log:
  Lots of localization of enrollment forms and authentications forms.
  Minor comment/POD changes to loncommon.pm in addition to localization.
  
  
--matthew1068239077
Content-Type: text/plain
Content-Disposition: attachment; filename="matthew-20031107160437.txt"

Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.18 loncom/localize/localize/newphrases.txt:1.19
--- loncom/localize/localize/newphrases.txt:1.18	Thu Nov  6 17:49:59 2003
+++ loncom/localize/localize/newphrases.txt	Fri Nov  7 16:04:37 2003
@@ -41,7 +41,55 @@
 The optional section or group field was not specified.
 The optional email address field was not specified.
 Continue enrollment?
+Username
+Last Name, First Names
+First Name
+Middle Names/Initials
+Last Name
+Generation
+ID/Student Number
+Group/Section
+Initial Password
+EMail Address
 
+Login Type
+Note: this will not take effect if the user already exists
+LON-CAPA Domain for Students
+# Do not translate this line.  [_1] is a drop-down box listing domains.
+LON-CAPA domain: [_1]
+Starting and Ending Dates
+Full Update
+Full update (also print list of users not enrolled anymore)
+Student Number
+Disable ID/Student Number Safeguard and Force Change of Conflicting IDs (only do if you know what you are doing)
+Note: for large courses, this operation may be time consuming
+
+CSV (comma separated values, spreadsheet)
+Space separated
+Tabulator separated
+HTML/XML
+Samples
+# Do not translate this line.  [_1] is a column index.
+Column [_1]'
+Associate columns with student attributes.
+Attribute
+Column
+Field
+Samples
+
+As a general rule, only authors or co-authors should be filesystem authenticated (which allows access to the server filesystem).
+
+# Do not translate this line.  [_1] is a check box
+[_1] Do not change login data
+
+# Do not translate this line.  [_1], [_3], and [_4] are check boxes
+# Do not translate this line.  [_2] is a text entry element
+[_1] Kerberos authenticated with domain [_2] [_3] Version 4 [_4] Version 5
+
+# Do not translate this line.  [_1] is a check box, [_2] is a text entry field
+[_1] Internally authenticated (with initial password [_2])
+[_1] Filesystem Authenticated (with initial password [_2])
+[_1] Local Authentication with arguement [_2]
 
 You must choose at least one student to continue.
 No changes were made to the current settings.
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.89 loncom/interface/londropadd.pm:1.90
--- loncom/interface/londropadd.pm:1.89	Thu Nov  6 17:49:59 2003
+++ loncom/interface/londropadd.pm	Fri Nov  7 16:04:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.89 2003/11/06 22:49:59 matthew Exp $
+# $Id: londropadd.pm,v 1.90 2003/11/07 21:04:37 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -500,52 +500,53 @@
     my $locform = &Apache::loncommon::authform_local(%param);
     my $domform = &domain_form($defdom);
     my $date_table = &date_setting_table();
-    $r->print(<<ENDPICK);
-</table>
-<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>
-$krbform
-</p>
-<p>
-$intform
-</p>
-<p>
-$locform
-</p>
-<h3>LON-CAPA Domain for Students</h3>
-LON-CAPA domain: $domform <p>
-<h3>Starting and Ending Dates</h3>
-<p>
-$date_table
-</p>
-<h3>Full Update</h3>
-<input type=checkbox name=fullup value=yes> Full update 
-(also print list of users not enrolled anymore)<p>
-<h3>ID/Student Number</h3>
-<input type=checkbox name=forceid value=yes> 
-Disable ID/Student Number Safeguard and Force Change of Conflicting IDs
-(only do if you know what you are doing)<p>
-<input type="button" onClick="javascript:verify(this.form)" value="Update Courselist" /><br />
-Note: for large courses, this operation may be time consuming.
-ENDPICK
+    my $Str = "</table>\n";
+    $Str .= &hidden_input('nfields',$i);
+    $Str .= &hidden_input('keyfields',$keyfields);
+    $Str .= '<h3>'.&mt('Login Type')."</h3>\n";
+    $Str .= "<p>\n".
+        &mt('Note: this will not take effect if the user already exists').
+        "</p><p>\n";
+    $Str .= $krbform."\n</p><p>\n".
+        $intform."\n</p><p>\n".
+        $locform."\n</p>\n";
+    $Str .= '<h3>'.&mt('LON-CAPA Domain for Students')."</h3>\n";
+    $Str .= "<p>\n".&mt('LON-CAPA domain: [_1]',$domform)."\n</p>\n";
+    $Str .= "<h3>".&mt('Starting and Ending Dates')."</h3>\n";
+    $Str .= "<p>\n".$date_table."</p>\n";
+    $Str .= "<h3>".&mt('Full Update')."</h3>\n";
+    $Str .= '<input type="checkbox" name="fullup" value="yes">'.
+        ' '.&mt('Full update (also print list of users not enrolled anymore)').
+        "</p>\n";
+    $Str .= "<h3>".&mt('Student Number')."</h3>\n";
+    $Str .= "<p>\n".'<input type="checkbox" name="forceid" value="yes">';
+    $Str .= &mt('Disable ID/Student Number Safeguard and Force Change '.
+                'of Conflicting IDs (only do if you know what you are doing)').
+                "\n</p><p>\n";
+    $Str .= '<input type="button" onClick="javascript:verify(this.form)" '.
+        'value="Update Courselist" />'."<br />\n";
+    $Str .= &mt('Note: for large courses, this operation may be time '.
+                'consuming');
+    $r->print($Str);
+    return;
 }
 
-# ======================================================= Menu Phase Two Upload
+###############################################################
+###############################################################
 sub print_upload_manager_form {
     my $r=shift;
     my $firstLine;
     my $datatoken;
     if (!$ENV{'form.datatoken'}) {
-      $datatoken=&Apache::loncommon::upfile_store($r);
+        $datatoken=&Apache::loncommon::upfile_store($r);
     } else {
-      $datatoken=$ENV{'form.datatoken'};
-      &Apache::loncommon::load_tmp_file($r);
+        $datatoken=$ENV{'form.datatoken'};
+        &Apache::loncommon::load_tmp_file($r);
     }
     my @records=&Apache::loncommon::upfile_record_sep();
-    if($ENV{'form.noFirstLine'}){$firstLine=shift(@records);}
+    if($ENV{'form.noFirstLine'}){
+        $firstLine=shift(@records);
+    }
     my $total=$#records;
     my $distotal=$total+1;
     my $today=time;
@@ -557,24 +558,28 @@
     my $i;
     my $keyfields;
     if ($total>=0) {
-	my @d=(['username','Username'],
-               ['names','Last Name, First Names'],
-	       ['fname','First Name'],
-               ['mname','Middle Names/Initials'],
-	       ['lname','Last Name'],
-               ['gen','Generation'],
-	       ['id','ID/Student Number'],
-               ['sec','Group/Section'],
-	       ['ipwd','Initial Password'],
-               ['email','EMail Address']);
+        my @field=(['username',&mt('Username')],
+                   ['names',&mt('Last Name, First Names')],
+                   ['fname',&mt('First Name')],
+                   ['mname',&mt('Middle Names/Initials')],
+                   ['lname',&mt('Last Name')],
+                   ['gen',&mt('Generation')],
+                   ['id',&mt('ID/Student Number')],
+                   ['sec',&mt('Group/Section')],
+                   ['ipwd',&mt('Initial Password')],
+                   ['email',&mt('EMail Address')]);
 	if ($ENV{'form.upfile_associate'} eq 'reverse') {	
 	    &Apache::loncommon::csv_print_samples($r,\@records);
-	    $i=&Apache::loncommon::csv_print_select_table($r,\@records,\@d);
-	    foreach (@d) { $keyfields.=$_->[0].','; }
+	    $i=&Apache::loncommon::csv_print_select_table($r,\@records,
+                                                          \@field);
+	    foreach (@field) { 
+                $keyfields.=$_->[0].','; 
+            }
 	    chop($keyfields);
 	} else {
-	    unshift(@d,['none','']);
-	    $i=&Apache::loncommon::csv_samples_select_table($r,\@records,\@d);
+	    unshift(@field,['none','']);
+	    $i=&Apache::loncommon::csv_samples_select_table($r,\@records,
+                                                            \@field);
 	    my %sone=&Apache::loncommon::record_sep($records[0]);
 	    $keyfields=join(',',sort(keys(%sone)));
 	}
@@ -582,7 +587,8 @@
     &print_upload_manager_footer($r,$i,$keyfields,$defdom,$today,$halfyear);
 }
 
-# ======================================================= Enroll single student
+###############################################################
+###############################################################
 sub enroll_single_student {
     my $r=shift;
     # Remove non alphanumeric values from section
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.143 loncom/interface/loncommon.pm:1.144
--- loncom/interface/loncommon.pm:1.143	Tue Nov  4 16:21:35 2003
+++ loncom/interface/loncommon.pm	Fri Nov  7 16:04:37 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.143 2003/11/04 21:21:35 matthew Exp $
+# $Id: loncommon.pm,v 1.144 2003/11/07 21:04:37 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -91,50 +91,19 @@
 my %designhash;
 
 # ---------------------------------------------- Thesaurus variables
-
-# FIXME: I don't think it's necessary to document these things;
-# they're privately used - Jeremy
-
-=pod
-
-=over 4
-
-=item * %Keywords  
-
-A hash used by &keyword to determine if a word is considered a keyword.
-
-=item * $thesaurus_db_file
-
-Scalar containing the full path to the thesaurus database.                 
-
-=back
-
-=cut
+#
+# %Keywords:
+#      A hash used by &keyword to determine if a word is considered a keyword.
+# $thesaurus_db_file 
+#      Scalar containing the full path to the thesaurus database.
 
 my %Keywords;
 my $thesaurus_db_file;
 
-# ----------------------------------------------------------------------- BEGIN
-
-# FIXME: I don't think this needs to be documented, it prepares
-# private data structures - Jeremy
-=pod
-
-=head1 General Subroutines
-
-=over 4
-
-=item * BEGIN() 
-
-Initialize values from language.tab, copyright.tab, filetypes.tab,
-thesaurus.tab, and filecategories.tab.
-
-=back
-
-=cut
-
-# ----------------------------------------------------------------------- BEGIN
-
+#
+# Initialize values from language.tab, copyright.tab, filetypes.tab,
+# thesaurus.tab, and filecategories.tab.
+#
 BEGIN {
     # Variable initialization
     $thesaurus_db_file = $Apache::lonnet::perlvar{'lonTabDir'}."/thesaurus.db";
@@ -235,6 +204,10 @@
 
 =pod 
 
+=head1 General Subroutines
+
+=over 4
+
 =head1 HTML and Javascript Functions
 
 =over 4
@@ -1088,10 +1061,10 @@
 
 sub authform_authorwarning{
     my $result='';
-    $result=<<"END";
-<i>As a general rule, only authors or co-authors should be filesystem
-authenticated (which allows access to the server filesystem).</i>
-END
+    $result='<i>'.
+        &mt('As a general rule, only authors or co-authors should be '.
+            'filesystem authenticated '.
+            '(which allows access to the server filesystem).')."</i>\n";
     return $result;
 }
 
@@ -1101,12 +1074,10 @@
               kerb_def_dom => 'MSU.EDU',
               @_,
           );
-    my $result='';
-    $result.=<<"END";
-<input type="radio" name="login" value="nochange" checked="checked"
-       onclick="javascript:changed_radio('nochange',$in{'formname'});" />
-Do not change login data
-END
+    my $result = &mt('[_1] Do not change login data',
+                     '<input type="radio" name="login" value="nochange" '.
+                     'checked="checked" onclick="'.
+            "javascript:changed_radio('nochange',$in{'formname'});".'" />');
     return $result;
 }
 
@@ -1117,24 +1088,23 @@
               kerb_def_auth => 'krb4',
               @_,
               );
-    my $result='';
-    my $check4;
-    my $check5;
+    my ($check4,$check5);
     if ($in{'kerb_def_auth'} eq 'krb5') {
        $check5 = " checked=\"on\"";
     } else {
        $check4 = " checked=\"on\"";
     }
-    $result.=<<"END";
-<input type="radio" name="login" value="krb" 
-       onclick="javascript:changed_radio('krb',$in{'formname'});"
-       onchange="javascript:changed_radio('krb',$in{'formname'});" />
-Kerberos authenticated with domain
-<input type="text" size="10" name="krbarg" value="$in{'kerb_def_dom'}"
-       onchange="javascript:changed_text('krb',$in{'formname'});" />
-<input type="radio" name="krbver" value="4" $check4 />Version 4
-<input type="radio" name="krbver" value="5" $check5 />Version 5
-END
+    my $jscall = "javascript:changed_radio('krb',$in{'formname'});";
+    my $result .= &mt
+        ('[_1] Kerberos authenticated with domain [_2] '.
+         '[_3] Version 4 [_4] Version 5',
+         '<input type="radio" name="login" value="krb" '.
+             'onclick="'.$jscall.'" onchange="'.$jscall.'" />',
+         '<input type="text" size="10" name="krbarg" '.
+             'value="'.$in{'kerb_def_dom'}.'" '.
+             'onchange="'.$jscall.'" />',
+         '<input type="radio" name="krbver" value="4" '.$check4.' />',
+         '<input type="radio" name="krbver" value="5" '.$check5.' />');
     return $result;
 }
 
@@ -1144,15 +1114,13 @@
                 kerb_def_dom => 'MSU.EDU',
                 @_,
                 );
-    my $result='';
-    $result.=<<"END";
-<input type="radio" name="login" value="int"
-       onchange="javascript:changed_radio('int',$args{'formname'});"
-       onclick="javascript:changed_radio('int',$args{'formname'});" />
-Internally authenticated (with initial password 
-<input type="text" size="10" name="intarg" value=""
-       onchange="javascript:changed_text('int',$args{'formname'});" />)
-END
+    my $jscall = "javascript:changed_radio('int',$args{'formname'});";
+    my $result.=&mt
+        ('[_1] Internally authenticated (with initial password [_2])',
+         '<input type="radio" name="login" value="int" '.
+             'onchange="'.$jscall.'" onclick="'.$jscall.'" />',
+         '<input type="text" size="10" name="intarg" value="" '.
+             'onchange="'.$jscall.'" />');
     return $result;
 }
 
@@ -1162,15 +1130,12 @@
               kerb_def_dom => 'MSU.EDU',
               @_,
               );
-    my $result='';
-    $result.=<<"END";
-<input type="radio" name="login" value="loc"
-       onchange="javascript:changed_radio('loc',$in{'formname'});"
-       onclick="javascript:changed_radio('loc',$in{'formname'});" />
-Local Authentication with argument
-<input type="text" size="10" name="locarg" value=""
-       onchange="javascript:changed_text('loc',$in{'formname'});" />
-END
+    my $jscall = "javascript:changed_radio('loc',$in{'formname'});";
+    my $result.=&mt('[_1] Local Authentication with arguement [_2]',
+                    '<input type="radio" name="login" value="loc" '.
+                        'onchange="'.$jscall.'" onclick="'.$jscall.'" />',
+                    '<input type="text" size="10" name="locarg" value="" '.
+                        'onchange="'.$jscall.'" />');
     return $result;
 }
 
@@ -1180,15 +1145,13 @@
               kerb_def_dom => 'MSU.EDU',
               @_,
               );
-    my $result='';
-    $result.=<<"END";
-<input type="radio" name="login" value="fsys" 
-       onchange="javascript:changed_radio('fsys',$in{'formname'});"
-       onclick="javascript:changed_radio('fsys',$in{'formname'});" />
-Filesystem authenticated (with initial password 
-<input type="text" size="10" name="fsysarg" value=""
-       onchange="javascript:changed_text('fsys',$in{'formname'});">)
-END
+    my $jscall = "javascript:changed_radio('fsys',$in{'formname'});";
+    my $result.= &mt
+        ('[_1] Filesystem Authenticated (with initial password [_2])',
+         '<input type="radio" name="login" value="fsys" '.
+         'onchange="'.$jscall.'" onclick="'.$jscall.'" />',
+         '<input type="text" size="10" name="fsysarg" value="" '.
+                  'onchange="'.$jscall.'" />');
     return $result;
 }
 
@@ -2510,26 +2473,39 @@
     return %components;
 }
 
+######################################################
+######################################################
+
 =pod
 
 =item * upfile_select_html()
 
-return HTML code to select file and specify its type
+Return HTML code to select a file from the users machine and specify 
+the file type.
 
 =cut
 
+######################################################
+######################################################
 sub upfile_select_html {
-    return (<<'ENDUPFORM');
-<input type="file" name="upfile" size="50" />
-<br />Type: <select name="upfiletype">
-<option value="csv">CSV (comma separated values, spreadsheet)</option>
-<option value="space">Space separated</option>
-<option value="tab">Tabulator separated</option>
-<option value="xml">HTML/XML</option>
-</select>
-ENDUPFORM
+    my %Types = (
+                 csv   => &mt('CSV (comma separated values, spreadsheet)'),
+                 space => &mt('Space separated'),
+                 tab   => &mt('Tabulator separated'),
+#                 xml   => &mt('HTML/XML'),
+                 );
+    my $Str = '<input type="file" name="upfile" size="50" />'.
+        '<br />Type: <select name="upfiletype">';
+    foreach my $type (sort(keys(%Types))) {
+        $Str .= '<option value="'.$type.'" >'.$Types{$type}."</option>\n";
+    }
+    $Str .= "</select>\n";
+    return $Str;
 }
 
+######################################################
+######################################################
+
 =pod
 
 =item * csv_print_samples($r,$records)
@@ -2540,15 +2516,18 @@
 
 =cut
 
+######################################################
+######################################################
 sub csv_print_samples {
     my ($r,$records) = @_;
     my (%sone,%stwo,%sthree);
     %sone=&record_sep($$records[0]);
     if (defined($$records[1])) {%stwo=&record_sep($$records[1]);}
     if (defined($$records[2])) {%sthree=&record_sep($$records[2]);}
-
-    $r->print('Samples<br /><table border="2"><tr>');
-    foreach (sort({$a <=> $b} keys(%sone))) { $r->print('<th>Column&nbsp;'.($_+1).'</th>'); }
+    #
+    $r->print(&mt('Samples').'<br /><table border="2"><tr>');
+    foreach (sort({$a <=> $b} keys(%sone))) { 
+        $r->print('<th>'.&mt('Column&nbsp;[_1]',($_+1)).'</th>'); }
     $r->print('</tr>');
     foreach my $hash (\%sone,\%stwo,\%sthree) {
 	$r->print('<tr>');
@@ -2562,23 +2541,31 @@
     $r->print('</tr></table><br />'."\n");
 }
 
+######################################################
+######################################################
+
 =pod
 
 =item * csv_print_select_table($r,$records,$d)
 
 Prints a table to create associations between values and table columns.
+
 $r is an Apache Request ref,
 $records is an arrayref from &Apache::loncommon::upfile_record_sep,
 $d is an array of 2 element arrays (internal name, displayed name)
 
 =cut
 
+######################################################
+######################################################
 sub csv_print_select_table {
     my ($r,$records,$d) = @_;
     my $i=0;my %sone;
     %sone=&record_sep($$records[0]);
-    $r->print('Associate columns with student attributes.'."\n".
-	     '<table border="2"><tr><th>Attribute</th><th>Column</th></tr>'."\n");
+    $r->print(&mt('Associate columns with student attributes.')."\n".
+	     '<table border="2"><tr>'.
+              '<th>'.&mt('Attribute').'</th>'.
+              '<th>'.&mt('Column').'</th></tr>'."\n");
     foreach (@$d) {
 	my ($value,$display)=@{ $_ };
 	$r->print('<tr><td>'.$display.'</td>');
@@ -2596,6 +2583,9 @@
     return $i;
 }
 
+######################################################
+######################################################
+
 =pod
 
 =item * csv_samples_select_table($r,$records,$d)
@@ -2608,22 +2598,25 @@
 
 =cut
 
+######################################################
+######################################################
 sub csv_samples_select_table {
     my ($r,$records,$d) = @_;
     my %sone; my %stwo; my %sthree;
     my $i=0;
-
-    $r->print('<table border=2><tr><th>Field</th><th>Samples</th></tr>');
+    #
+    $r->print('<table border=2><tr><th>'.
+              &mt('Field').'</th><th>'.&mt('Samples').'</th></tr>');
     %sone=&record_sep($$records[0]);
     if (defined($$records[1])) {%stwo=&record_sep($$records[1]);}
     if (defined($$records[2])) {%sthree=&record_sep($$records[2]);}
-
+    #
     foreach (sort keys %sone) {
-	$r->print('<tr><td><select name=f'.$i.
+	$r->print('<tr><td><select name="f'.$i.'"'.
 		  ' onchange="javascript:flip(this.form,'.$i.');">');
 	foreach (@$d) {
 	    my ($value,$display)=@{ $_ };
-	    $r->print('<option value='.$value.'>'.$display.'</option>');
+	    $r->print('<option value="'.$value.'">'.$display.'</option>');
 	}
 	$r->print('</select></td><td>');
 	if (defined($sone{$_})) { $r->print($sone{$_}."</br>\n"); }
@@ -2636,6 +2629,9 @@
     return($i);
 }
 
+######################################################
+######################################################
+
 =pod
 
 =item clean_excel_name($name)
@@ -2644,6 +2640,8 @@
 
 =cut
 
+######################################################
+######################################################
 sub clean_excel_name {
     my ($name) = @_;
     $name =~ s/[:\*\?\/\\]//g;

--matthew1068239077--