--- loncom/interface/lonfeedback.pm 2006/11/28 22:27:56 1.219 +++ loncom/interface/lonfeedback.pm 2006/11/29 03:23:02 1.220 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.219 2006/11/28 22:27:56 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.220 2006/11/29 03:23:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -291,6 +291,13 @@ sub list_discussion { 'disp' => 'Display', 'nolo' => 'Not new', 'togg' => 'Toggle read/unread', + 'aner' => 'An error occurred opening the manifest file.', + 'difo' => 'Discussion for', + 'aerr' => 'An error occurred opening the export file for posting', + 'aysu' => 'Are you sure you want to delete this post?', + 'dpwn' => 'Deleted posts will no longer be visible to you and other students', + 'bwco' => 'but will continue to be visible to your instructor', + 'depo' => 'Deleted posts will no longer be visible to you or anyone else.', ); my $currdisp = $lt{'allposts'}; @@ -385,9 +392,9 @@ identifier="MANIFEST-$ressymb" xsi:schem imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd"> - Discussion for $ressymb\n|; + $lt{'difo'} $ressymb\n|; } else { - $discussion .= 'An error occurred opening the manifest file.
'; + $discussion .= $lt{'aner'}.'
'; } } else { my $colspan=$maxdepth+1; @@ -400,12 +407,12 @@ imscp_v1p1.xsd http://www.imsglobal.org/ prevparm = "&previous="+previous } if (caller == 'studentdelete') { - if (confirm("Are you sure you want to delete this post?\\nDeleted posts will no longer be visible to you and other students,\\nbut will continue to be visible to your instructor")) { + if (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) { document.location.href = "/adm/feedback?hide="+symbparm+prevparm+groupparm } } else { if (caller == 'seeiddelete') { - if (confirm("Are you sure you want to delete this post?\\nDeleted posts will no longer be visible to you or anyone else")) { + if (confirm("$lt{'aysu'}\\n$lt{'depo'}")) { document.location.href = "/adm/feedback?deldisc="+symbparm+prevparm+groupparm } } @@ -463,7 +470,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ } $discussion .= ''; - my $numhidden = keys %notshown; + my $numhidden = keys(%notshown); if ($numhidden > 0) { my $colspan = $maxdepth+1; $discussion.="\n".''. @@ -567,7 +574,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $imsitems{$alldiscussion{$_}}{'attach'}.''."\n"; close($postingfile); } else { - $discussion .= 'An error occurred opening the export file for posting '.$alldiscussion{$_}.'
'; + $discussion .= $lt{'aerr'}.' '.$alldiscussion{$_}.'
'; } $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$_}}{'allattachments'},$tempexport); } else { @@ -627,7 +634,6 @@ END $discussion .= &mt('Posts by').':'; if ($totposters > 0) { foreach my $poster (@posters) { - $poster =~ s/:/\@/; $discussion .= ' '.$poster.','; } $discussion =~ s/,$//; @@ -708,13 +714,13 @@ END open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $discussion .= 'Download the zip file from Discussion Posting Archive
'; + $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','').'
'; if ($copyresult) { - $discussion .= 'The following errors occurred during export -
'.$copyresult; + $discussion .= &mt('The following errors occurred during export').' -
'.$copyresult; } } } else { - $discussion .= '
Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.
'; + $discussion .= '
'.&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'
'; } return $discussion; } @@ -777,15 +783,21 @@ sub postingform_display { my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, $currnewattach,$currdelold,$group) = @_; my $newattachmsg; + my %lt = &Apache::lonlocal::texthash( + 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', + 'title' => 'Title', + 'podi' => 'Post Discussion', + 'poan' => 'Post Anonymous Discussion', + 'newa' => 'New attachments', + ); my $postingform = (< - +
+
-Note: in anonymous discussion, your name is visible only -to course faculty
-Title: 

+$lt{'note'}
+$lt{'title'}: 

ENDDISCUSS if ($env{'form.origpage'}) { @@ -809,7 +821,7 @@ ENDDISCUSS $now,$currnewattach, $currdelold,'',$mode); if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { - $newattachmsg = '
New attachments
'; + $newattachmsg = '
'.$lt{'newa'}.'
'; if (@{$currnewattach} > 1) { $newattachmsg .= '
    '; foreach my $item (@{$currnewattach}) { @@ -1335,7 +1347,7 @@ sub get_post_contents { if ($type eq 'export') { $$imsfiles{$idx}{$i} = ''; if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:
    '; + $$attachtxt{$i} = '
    '.&mt('Attachments').':
    '; foreach (sort keys %currattach) { if ($$allattachments{$_}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { my $fname = $1.$3.'/'.$4; @@ -1346,7 +1358,7 @@ sub get_post_contents { } } else { if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:'.$attachmsg.'
    '; + $$attachtxt{$i} = '
    '.&mt('Attachments').':'.$attachmsg.'
    '; } else { $$attachtxt{$i} = ''; } @@ -1393,11 +1405,11 @@ sub replicate_attachments { print $attachcopy $content; close($attachcopy); } else { - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package',$5).': '.$!.'
    '."\n"; } } else { &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode"); - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$rtncode.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package: ',$5).$rtncode.'
    '."\n"; } } } @@ -1411,6 +1423,13 @@ sub mail_screen { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']); } + my %lt = &Apache::lonlocal::texthash( + 'plch' => 'Please check at least one of the following feedback types:', + 'myqu' => 'My question/comment/feedback:', + 'title' => 'Title', + 'reta' => 'Retained attachments', + 'atta' => 'Attachment (128 KB max size)', + ); my $title=&Apache::lonnet::gettitle($feedurl); if (!$title) { $title = $feedurl; } my $quote=''; @@ -1501,7 +1520,7 @@ END if ($idx > 0) { my %subversions = (); &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); - $subject = 'Re: '.$subversions{$numoldver}; + $subject = &mt('Re: ')..$subversions{$numoldver}; } $subject = &HTML::Entities::encode($subject,'<>&"'); } else { @@ -1548,6 +1567,7 @@ END } my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); my $send=&mt('Send'); + my $alert = &mt('Please select a feedback type.'); my $js= < //