--- loncom/interface/portfolio.pm 2008/01/21 11:36:07 1.187 +++ loncom/interface/portfolio.pm 2008/01/21 18:00:30 1.188 @@ -1,7 +1,7 @@ # The LearningOnline Network # portfolio browser # -# $Id: portfolio.pm,v 1.187 2008/01/21 11:36:07 bisitz Exp $ +# $Id: portfolio.pm,v 1.188 2008/01/21 18:00:30 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -339,7 +339,7 @@ sub display_directory { undef($colspan); } $r->print(''.&mt('closed folder').''); - $r->print('Go to ...'); + $r->print(''.&mt('Go to ...').''); my %anchor_fields = ( 'selectfile' => $filename.'/', 'currentpath' => $current_path.$filename.'/', @@ -363,7 +363,7 @@ sub display_directory { my %anchor_fields = ( 'lockinfo' => $fullpath ); - $line.=''.&make_anchor($url,\%anchor_fields,'Locked').''; + $line.=''.&make_anchor($url,\%anchor_fields,&mt('Locked')).''; $css_class= 'LC_browser_file_locked'; } else { if (!$can_modify) { @@ -381,7 +381,7 @@ sub display_directory { 'rename' => $filename, currentpath => $current_path ); - $line .= &make_anchor($url,\%anchor_fields,'Rename'); + $line .= &make_anchor($url,\%anchor_fields,&mt('Rename')); $line .= ''.&make_anchor($href_edit_location.$filename.'.meta',\%anchor_fields,$cat); # ''.$cat.''; } @@ -543,7 +543,7 @@ sub delete { } else { if (scalar(@files)) { &open_form($r,$url); - $r->print('

'.&mt('Delete').' '.&display_file(undef,\@files).'?

'); + $r->print('

'.&mt('Delete [_1]?',&display_file(undef,\@files)).'

'); &close_form($r,$url); } else { $r->print("No file was checked to delete.
"); @@ -610,7 +610,7 @@ sub delete_confirmed { sub delete_dir { my ($r,$url)=@_; &open_form($r,$url); - $r->print('

'.&mt('Delete').' '.&display_file().'?

'); + $r->print('

'.&mt('Delete [_1]?',&display_file()).'

'); &close_form($r,$url); } @@ -625,8 +625,10 @@ sub delete_dir_confirmed { $directory_name); if ($result ne 'ok') { - $r->print(' An error occurred (dir) ('.$result. - ') while trying to delete '.$directory_name.'
'); + $r->print('' + .&mt('An error occurred (dir) ([_1]) while trying to delete [_2].' + ,$result,$directory_name) + .'
'); } else { # now remove from recent &Apache::lonhtmlcommon::remove_recent($namespace,[$directory_name.'/']); @@ -650,8 +652,8 @@ sub rename { $r->print(&done(undef,$url)); } else { &open_form($r,$url); - $r->print('

'.&mt('Rename').' '.&display_file().' to - ?

'); + $r->print('

'.&mt('Rename [_1] to [_2]?', &display_file() + , '').'

'); &close_form($r,$url); } } @@ -677,9 +679,9 @@ sub rename_confirmed { $chg_access = &access_for_renamed($filenewname,$group,$udom,$uname); } else { $r->print(''. - &mt('An error occurred ([_1]) while trying to rename [_2]' - .' to [_3]',$result,&display_file(), - &display_file('',$filenewname)).'
'); + &mt('An error occurred ([_1]) while trying to rename [_2] to [_3]' + ,$result,&display_file(),&display_file('',$filenewname)) + .'
'); return; } if ($filenewname ne $env{'form.filenewname'}) { @@ -782,7 +784,7 @@ sub display_access { $action); my $button_text = { 'continue' => &mt('Proceed'), - 'cancel' => &mt('Back to Directory'), + 'cancel' => &mt('Return to directory'), }; &close_form($r,$url,$button_text); } else { @@ -810,7 +812,7 @@ sub view_access_settings { $todisplay{$scope}{$key} = $$access_controls{$key}; } if ($aclcount) { - $r->print(&mt('

Current access controls defined for this file:

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

'.&mt('Current access controls defined for this file:').'

'); $r->print(&Apache::loncommon::start_data_table()); $r->print(&Apache::loncommon::start_data_table_header_row()); $r->print(''.&mt('Access control').''.&mt('Dates available'). @@ -821,12 +823,12 @@ sub view_access_settings { &build_access_summary($r,$count,$chg,%todisplay); $r->print(&Apache::loncommon::end_data_table()); } else { - $r->print(&mt('No access control settings currently exist for this file.
' )); + $r->print(&mt('No access controil settings currently exist for this file.').'
'); } my %anchor_fields = ( 'currentpath' => $env{'form.currentpath'} ); - $r->print('
'.&make_anchor($url, \%anchor_fields, &mt('Return to directory listing'))); + $r->print('
'.&make_anchor($url, \%anchor_fields, &mt('Return to directory'))); return; } @@ -1031,7 +1033,7 @@ sub update_access { &open_form($r,$url); foreach my $newitem ('course','domains','users') { if ($env{'form.new'.$newitem} > 0) { - $r->print('
'.&mt('Add new [_1]-based access control for portfolio file: [_2]',$newitem,$env{'form.currentpath'}.$env{'form.selectfile'}).'

'); + $r->print('
'.&mt('Add new [_1]-based access control for portfolio file: [_2]',&mt($newitem),$env{'form.currentpath'}.$env{'form.selectfile'}).'

'); $firstitem = $totalnew; $lastitem = $totalnew + $env{'form.new'.$newitem}; $totalnew = $lastitem; @@ -1051,7 +1053,7 @@ sub update_access { ); $r->print('
'.&make_anchor($url, \%anchor_fields, &mt('Display all access settings for this file'))); delete $anchor_fields{'access'}; - $r->print('     '.&make_anchor($url,\%anchor_fields,&mt('Return to directory listing'))); + $r->print('     '.&make_anchor($url,\%anchor_fields,&mt('Return to directory'))); } return; } @@ -1311,7 +1313,7 @@ sub access_element { my $title = $type; $title =~ s/s$//; $title =~ s/^(\w)/uc($1)/e; - $r->print('

'.&mt('[_1]-based conditional access: ',$title)); + $r->print('

'.&mt('[_1]-based conditional access: ',&mt($title))); if ($$acl_count{$type}) { $r->print($$acl_count{$type}.' '); if ($$acl_count{$type} > 1) { @@ -1366,7 +1368,7 @@ sub display_access_row { } $r->print(&Apache::loncommon::end_data_table()); } else { - $r->print(&mt('No [_1]-based conditions defined.',$type).'
' + $r->print(&mt('No [_1]-based conditions defined.',&mt($type)).'
' .&additional_item($type)); } return; @@ -1526,7 +1528,7 @@ sub users_row { sub additional_item { my ($type) = @_; - my $output = &mt('Add new [_1] condition(s)?',$type).' '.&mt('Number to add: ').''; + my $output = &mt('Add new [_1] condition(s)?',&mt($type)).' '.&mt('Number to add: ').''; return $output; } @@ -1781,7 +1783,7 @@ sub check_for_upload { } elsif ($found_file) { if ($locked_file) { my $msg = ''; - $msg .= &mt('Unable to upload [_1] a locked file by that name was found in [_2].',''.$fname.'',''.$port_path.$env{'form.currentpath'}.''); + $msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].',''.$fname.'',''.$port_path.$env{'form.currentpath'}.''); $msg .= '
'; $msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.',''.$fname.''); return ('file_locked',$msg); @@ -1821,8 +1823,8 @@ sub upload { $port_path.$env{'form.currentpath'}, $mode,\%allfiles,\%codebase); if ($result !~ m|^/uploaded/|) { - $r->print(''.'An error occurred ('.$result. - ') while trying to upload '.&display_file().'
'); + $r->print(''.&mt('An error occurred ([_1]) while trying to upload [_2].' + ,$result,&display_file()).'
'); $r->print(&done('Back',$url)); } else { if (%allfiles) { @@ -1838,7 +1840,7 @@ STATE $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase, {'error_on_invalid_names' => 1, 'ignore_remote_references' => 1,})); - $r->print('

Or '.&done('Return to directory listing',$url).'

'); + $r->print('

Or '.&done('Return to directory',$url).'

'); } else { $r->print(&done(undef,$url)); } @@ -1880,8 +1882,10 @@ sub upload_embedded { &Apache::lonnet::userfileupload('embedded_item_'.$i,'', $port_path.$path); if ($result !~ m|^/uploaded/|) { - $r->print(''.'An error occurred ('.$result. - ') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'
'); + $r->print('' + .&mt('An error occurred ([_1]) while trying to upload [_2] for embedded element [_3].' + ,$result,$orig_uploaded_filename,$env{'form.embedded_orig_'.$i}) + .'
'); next; } else { $r->print("

Uploaded ". @@ -1926,8 +1930,7 @@ sub lock_info { my %course_description = &Apache::lonnet::coursedescription($$array_item[1]); if ( $course_description{'description'} ne '') { - $r->print(&mt('In the course: [_1]
', - $course_description{'description'})); + $r->print(&mt('In the course:').' '.$course_description{'description'}.'
'); } } } @@ -1955,20 +1958,24 @@ sub createdir { } } if ($found_file){ - $r->print(''.&mt('Unable to create a directory named').' '.$newdir. - '. '.&mt('A file or directory by that name already exists.').'
'); + $r->print('' + .&mt('Unable to create a directory named [_1].',''.$newdir.'') + .' '.&mt('A file or directory by that name already exists.').'
'); } else { my ($uname,$udom) = &get_name_dom(); my $port_path = &get_port_path(); my $result=&Apache::lonnet::mkdiruserfile($uname,$udom, $port_path.$env{'form.currentpath'}.$newdir); if ($result ne 'ok') { - $r->print(''.'An error occurred ('.$result. - ') while trying to create a new directory '.&display_file().'
'); + $r->print('' + .&mt('An error occurred ([_1]) while trying to create a new directory [_2].' + ,$result,&display_file()) + .'
'); } } if ($newdir ne $env{'form.newdir'}) { - $r->print(&mt("The new directory name was changed from:")."
".$env{'form.newdir'}." ".&mt('to')." $newdir "); + $r->print(&mt('The new directory name was changed from [_1] to [_2].' + ,''.$env{'form.newdir'}.'',''.$newdir.'')); } $r->print(&done(undef,$url)); } @@ -2069,7 +2076,7 @@ sub missing_priv { $rtnlink .= '?'; } $rtnlink .= 'currentpath='.$escpath; - $r->print(&mt('

Action disallowed

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

'.&mt('Action disallowed').'

'); $r->print(&mt('You do not have sufficient privileges to [_1] ', $longtext->{$priv})); if (defined($env{'form.group'})) { @@ -2078,7 +2085,7 @@ sub missing_priv { } else { $r->print(&mt('in this portfolio.')); } - $rtnlink .= '">'.&mt('Return to directory listing page').''; + $rtnlink .= '">'.&mt('Return to directory').''; $r->print('
'.$rtnlink); $r->print(&Apache::loncommon::end_page()); return; @@ -2170,7 +2177,7 @@ sub handler { $r->print(&mt('Not a valid group for this course')); $earlyout = 1; } - $title = &mt('Group files').' for '.$group; + $title = &mt('Group files for [_1]', $group); } else { $r->print(&mt('Invalid group')); $earlyout = 1; @@ -2229,8 +2236,8 @@ sub handler { } if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ $r->print(''); - $r->print(&mt('No file was selected to upload. ')); - $r->print(&mt('To upload a file, click Browse... select a file, then click Upload.')); + $r->print(&mt('No file was selected to upload.').' '); + $r->print(&mt('To upload a file, click Browse... and select a file, then click Upload.')); $r->print(''); } if ($env{'form.meta'}) {