--- loncom/interface/slotrequest.pm 2009/01/23 21:34:47 1.86 +++ loncom/interface/slotrequest.pm 2009/02/02 02:56:12 1.87 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.86 2009/01/23 21:34:47 raeburn Exp $ +# $Id: slotrequest.pm,v 1.87 2009/02/02 02:56:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -345,8 +345,8 @@ sub remove_registration { return; } if (!%consumed) { - $r->print("

".&mt('Slot [_1] has no reservations.', - $slot_name)."

"); + $r->print('

'.&mt('Slot [_1] has no reservations.', + ''.$slot_name.'').'

'); return; } @@ -557,15 +557,15 @@ sub delete_slot { my $ret = &Apache::lonnet::cput('slots', {$slot_name => \%slot}, $cdom, $cnum); if ($ret eq 'ok') { - $r->print("

Slot $slot_name marked as deleted.

"); + $r->print('

'.&mt('Slot [_1] marked as deleted.',''.$slot_name.'').'

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

An error ($ret) occurse when attempting to delete Slot $slot_name.

"); + $r->print('

'.&mt('An error occurred when attempting to delete slot: [_1]',''.$slot_name.'')." ($ret)

"); } } else { if (%consumed) { - $r->print("

Slot $slot_name has active reservations.

"); + $r->print('

'.&mt('Slot [_1] has active reservations.',''.$slot_name.'').'

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

Slot $slot_name does not exist.

"); + $r->print('

'.&mt('Slot [_1] does not exist.',''.$slot_name.'').'

'); } } $r->print('

'. @@ -597,7 +597,7 @@ sub get_slot { my $description1=&get_description($slot_name,\%slot); %slot=&Apache::lonnet::get_slot($env{'form.slotname'}); my $description2=&get_description($env{'form.slotname'},\%slot); - $r->print("

Already have a reservation: $description1

"); + $r->print('

'.&mt('Already have a reservation: [_1].',$description1).'

'); if ($slot_name ne $env{'form.slotname'}) { $r->print(< @@ -606,13 +606,7 @@ sub get_slot { STUFF - $r->print("

You can either "); - $r->print(< -STUFF - $r->print(' your reservation from '.$description1.' to '. - $description2. - '
or

'); + $r->print('

'.&mt('You can either [_1] your reservation from [2] to [_3] or [_4]','',''.$description1.'',''.$description2.'
','

')); &return_link($r); $r->print(< @@ -633,17 +627,18 @@ STUFF .&mt('An error occurred while attempting to make a reservation. ([_1])',$1) .'

'); } elsif ($reserved > -1) { - $r->print("

Success: $description

"); + $r->print('

'.&mt('Success: [_1]',$description).'

'); $retvalue = 1; } elsif ($reserved < 0) { - $r->print("

Already reserved: $description

"); + $r->print('

'.&mt('Already reserved: [_1]',$description).'

'); } if (!$inhibit_return_link) { &return_link($r); } return 1; } my %lt=('request'=>"Availibility list", - 'try' =>'Try again'); + 'try' =>'Try again?', + 'or' => 'or'); %lt=&Apache::lonlocal::texthash(%lt); my $extra_input; @@ -651,8 +646,8 @@ STUFF $extra_input=''; } + $r->print('

'.&mt('[_1]Failed[_2] to reserve a slot for [_3].','','',$description).'

'); $r->print(< Failed to reserve a spot for $description.

@@ -661,19 +656,20 @@ STUFF $extra_input
-?

-or +$lt{'or'}

-

-or STUFF - if (!$inhibit_return_link) { &return_link($r); } + if (!$inhibit_return_link) { + $r->print(&mt('or').'

').&return_link($r); + } else { + $r->print('

'); + } return 0; } @@ -859,7 +855,8 @@ STUFF } if (!$available) { - $r->print('No available times.
'. + $r->print(''.&mt('No available times.'). + ' '. &mt('Return to last resource').''); } $r->print(''); @@ -1346,7 +1343,7 @@ sub upload_start { $result.=' '. &mt('Specify a file containing the slot definitions.'). ''."\n"; - $result.=''."\n"; + $result.=''."\n"; my $upfile_select=&Apache::loncommon::upfile_select_html(); my $ignore=&mt('Ignore First Line'); $result.=<print(< -
+
ENDPICK } @@ -1522,7 +1520,7 @@ sub csv_upload_assign { my @slotdata = &Apache::loncommon::upfile_record_sep(); if ($env{'form.noFirstLine'}) { shift(@slotdata); } my %fields=&Apache::grades::get_fields(); - $r->print('

Creating Slots

'); + $r->print('

'.&mt('Creating Slots').'

'); my $cname=$env{'course.'.$env{'request.course.id'}.'.num'}; my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'}; my $countdone=0; @@ -1609,9 +1607,9 @@ sub csv_upload_assign { $r->rflush(); $countdone++; } - $r->print("

Created $countdone slots\n

"); + $r->print('

'.&mt('Created [quant,_1,slot]',$countdone)."\n".'

'); foreach my $error (@errors) { - $r->print("

$error

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

'.$error.'

'."\n"); } &show_table($r,$mgr); return ''; @@ -1699,7 +1697,7 @@ sub handler { &release_slot($r,$symb,$env{'form.releaseslot'}); } } else { - $r->print("

Unknown command: ".$env{'form.command'}."

"); + $r->print('

'.&mt('Unknown command: [_1]',$env{'form.command'}).'

'); } } &end_page($r);