--- loncom/auth/lonroles.pm 2003/09/17 18:16:39 1.71 +++ loncom/auth/lonroles.pm 2003/09/18 20:10:18 1.72 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.71 2003/09/17 18:16:39 albertel Exp $ +# $Id: lonroles.pm,v 1.72 2003/09/18 20:10:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,7 @@ use Apache::File(); use Apache::lonmenu; use Apache::loncommon; use Apache::lonannounce; +use Apache::lonlocal; sub redirect_user { my ($r,$title,$url,$msg) = @_; @@ -164,7 +165,7 @@ ENDENTERKEY 'request.role.adv' => $tadv, 'request.role.domain' => $cdom, 'request.course.sec' => $csec); - my $msg='Entering course ...'; + my $msg=&mt('Entering course ...'); if (($cnum) && ($role ne 'ca')) { my ($furl,$ferr)= @@ -183,7 +184,9 @@ ENDENTERKEY "request.course.id" => $cdom.'_'.$cnum); $furl='/adm/roles?tryagain=1'; $msg= - '

Could not initialize course at this time.

Please try again.

'.$ferr; + '

'. + &mt('Could not initialize course at this time.'). + '

'.&mt('Please try again.').'

'.$ferr; } # Check to see if the user is a CC entering a course @@ -274,34 +277,35 @@ ENDHEADER } else { if ($ENV{'user.error.msg'}) { $r->print( - '

You need to choose another user role or '. - 'enter a specific course for this function

'); + '

'. + &mt('You need to choose another user role or enter a specific course for this function').'

'); } } # -------------------------------------------------------- Choice or no choice? if ($nochoose) { if ($advanced) { - $r->print("

Assigned User Roles

\n"); + $r->print("

".&mt('Assigned User Roles')."

\n"); } else { - $r->print("

Sorry ...

\nThis resource might be part of"); + $r->print("

".&mt('Sorry ...')."

\n". + &mt('This resource might be part of')); if ($ENV{'request.course.id'}) { - $r->print(' another'); + $r->print(&mt(' another')); } else { - $r->print(' a certain'); + $r->print(&mt(' a certain')); } - $r->print(' course.'); + $r->print(&mt(' course.').''); return OK; } } else { if ($advanced) { - $r->print("Your home server is ". + $r->print(&mt("Your home server is "). $Apache::lonnet::hostname{&Apache::lonnet::homeserver ($ENV{'user.name'},$ENV{'user.domain'})}. "
\n"); - $r->print("Author and Co-Author roles may not be available on ". - "servers other than your home server."); + $r->print(&mt( + "Author and Co-Author roles may not be available on servers other than your home server.")); } else { - $r->print("

Select a Course to Enter

\n"); + $r->print("

".&mt('Select a Course to Enter')."

\n"); } if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; @@ -312,15 +316,16 @@ ENDHEADER } if ($ENV{'user.adv'}) { $r->print( - '
Show all roles: '.&mt('Show all roles').': print(' checked'); } - $r->print('>'); + $r->print('>'); } # ----------------------------------------------------------------------- Table $r->print('
'); unless ($nochoose) { $r->print(''); } - $r->print(''. - ''."\n"); + $r->print(''."\n"); foreach $envkey (sort keys %ENV) { my $button = 1; @@ -365,23 +370,24 @@ ENDHEADER $button=0; } elsif ($tstatus eq 'will') { $tbg='#FFAA77'; - $tremark.='Active at next login. '; + $tremark.=&mt('Active at next login. '); } elsif ($tstatus eq 'expired') { $tbg='#FF7777'; $tfont='#330000'; $button=0; } elsif ($tstatus eq 'will_not') { $tbg='#AAFF77'; - $tremark.='Expired after logout. '; + $tremark.=&mt('Expired after logout. '); } elsif ($tstatus eq 'selected') { $tbg='#11CC55'; $tfont='#002200'; - $tremark.='Currently selected. '; + $tremark.=&mt('Currently selected. '); } my $trole; if ($role =~ /^cr\//) { my ($rdummy,$rdomain,$rauthor,$rrole)=split(/\//,$role); - $tremark.='
Defined by '.$rauthor.' at '.$rdomain.'.'; + $tremark.='
'.&mt('Defined by ').$rauthor. + &mt(' at ').$rdomain.'.'; $trole=$rrole; } else { $trole=Apache::lonnet::plaintext($role); @@ -403,9 +409,10 @@ ENDHEADER } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; - $ttype='Construction Space'; - $twhere='User: '.$trest.'
Domain: '.$tdom.'
'. - ' Server: '.$home; + $ttype=&mt('Construction Space'); + $twhere=&mt('User').': '.$trest.'
'.&mt('Domain'). + ': '.$tdom.'
'. + ' '.&mt('Server').': '.$home; $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca'; } elsif ($role eq 'au') { # Authors @@ -421,20 +428,21 @@ ENDHEADER } #next if ($home eq 'no_host'); $home = $Apache::lonnet::hostname{$home}; - $ttype='Construction Space'; - $twhere='Domain: '.$tdom.'
Server: '.$home; + $ttype=&mt('Construction Space'); + $twhere=&mt('Domain').': '.$tdom.'
'.&mt('Server'). + ': '.$home; $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca'; } elsif ($trest) { - $ttype='Course'; + $ttype=&mt('Course'); if ($tsection) { - $ttype.='
Section/Group: '.$tsection; + $ttype.='
'.&mt('Section/Group').': '.$tsection; } my $tcourseid=$tdom.'_'.$trest; if ($ENV{'course.'.$tcourseid.'.description'}) { $twhere=$ENV{'course.'.$tcourseid.'.description'}; - unless ($twhere eq 'Currently not available') { + unless ($twhere eq &mt('Currently not available')) { $twhere.=' '. - &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont). + &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). ''; } } else { @@ -443,20 +451,20 @@ ENDHEADER if (%newhash) { $twhere=$newhash{'description'}. ' '. - &Apache::loncommon::syllabuswrapper('Syllabus',$trest,$tdom,$tfont). + &Apache::loncommon::syllabuswrapper(&mt('Syllabus'),$trest,$tdom,$tfont). ''; } else { - $twhere='Currently not available'; + $twhere=&mt('Currently not available'); $ENV{'course.'.$tcourseid.'.description'}=$twhere; } } - if ($role ne 'st') { $twhere.="
Domain:".$tdom; } + if ($role ne 'st') { $twhere.="
".&mt('Domain').":".$tdom; } } elsif ($tdom) { - $ttype='Domain'; + $ttype=&mt('Domain'); $twhere=$tdom; } else { - $ttype='System'; - $twhere='system wide'; + $ttype=&mt('System'); + $twhere=&mt('system wide'); } $r->print(''); @@ -464,21 +472,22 @@ ENDHEADER if (!$button) { if ($switchserver) { $r->print(''); + $switchserver.'">'.&mt('Switch Server').''); } else { $r->print(''); } } elsif ($tstatus eq 'is') { - $r->print(''); } elsif ($tryagain) { $r->print - (''); + (''); } elsif ($advanced) { $r->print - (''); + (''); } else { $r->print(''); } @@ -500,19 +509,20 @@ ENDHEADER my $tfont='#003300'; if ($ENV{'request.role'} eq 'cm') { $r->print(''); - $tremark='Currently selected.'; + $tremark=&mt('Currently selected. '); $tfont='#002200'; } else { $r->print(''); } unless ($nochoose) { if ($ENV{'request.role'} ne 'cm') { - $r->print(''); + $r->print(''); } else { $r->print(''); } } - $r->print(''."\n");
 User RoleExtentStartEndRemark
'.&mt('User Role').''.&mt('Extent'). + ''.&mt('Start').''.&mt('End').''. + &mt('Remark').'
Switch Server  
 No role specified'. + $r->print(''.&mt('No role specified'). ''.$tremark. '