[LON-CAPA-cvs] cvs: loncom /interface lonmsgdisplay.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 08 Dec 2006 14:43:38 -0000


This is a MIME encoded message

--raeburn1165589018
Content-Type: text/plain

raeburn		Fri Dec  8 09:43:38 2006 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  bug 3841 - Save => Store
  
  Internationalization
  
  More use of &mt([quant,_1,....]) 
  
  
--raeburn1165589018
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20061208094338.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.49 loncom/interface/lonmsgdisplay.pm:1.50
--- loncom/interface/lonmsgdisplay.pm:1.49	Thu Dec  7 16:21:04 2006
+++ loncom/interface/lonmsgdisplay.pm	Fri Dec  8 09:43:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.49 2006/12/07 21:21:04 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.50 2006/12/08 14:43:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,8 +74,8 @@
 interface, or other features they may wish to use in response to the
 student's query.
 
-=item * B<Blocking>: LON-CAPA can block display of e-mails that are 
-sent to a student during an online exam. A course coordinator or
+=item * B<Blocking>: LON-CAPA can block selected communication 
+features for students during an online exam. A course coordinator or
 instructor can set an open and close date/time for scheduled online
 exams in a course. If a user uses the LON-CAPA internal messaging 
 system to display e-mails during the scheduled blocking event,  
@@ -143,6 +143,14 @@
                 fold => 'Folder',
                 show => 'Show',
                 go   => 'Go',
+                nnff => 'New Name for Folder',
+                newn => 'New Name',
+                thfm => 'The folder may not be renamed',
+                fmnb => 'folder may not be renamed as it is a folder provided by the system.',
+                asth => 'as this name is already in use for a system-provided or user-defined folder.',
+                the => 'The',
+                tnfm => 'The new folder may not be named',
+
     );
 
     my %actions = &Apache::lonlocal::texthash(
@@ -182,16 +190,16 @@
         if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') {
             for (var i=0; i<permfolders_keys.length; i++) {
                 if (permfolders_keys[i] == targetform.folder.value) {
-                    alert("The '"+permfolders_vals[i]+"' folder may not be renamed as it is a mail folder provided by the system.");
+                    alert("$lt{'the'} '"+permfolders_vals[i]+"' $lt{'fmnb'}");
                     return;
                 }
             }
-            var foldername=prompt('New Name for Folder','New Name');
+            var foldername=prompt('$lt{'nnff'}','$lt{'newn'}');
             if (foldername) {
                 targetform.renamed.value=foldername;
                 for (var i=0; i<allfolders.length; i++) {
                     if (allfolders[i] == foldername) {
-                        alert("The folder may not be renamed '"+foldername+"' as this name is already in use for a system-provided or user-defined folder.");
+                        alert("$lt{'thfm'} '"+foldername+"' $lt{'asth'}");
                         return;
                     }
                 }
@@ -207,7 +215,7 @@
         if (newname) {
             for (var i=0; i<allfolders.length; i++) {
                 if (allfolders[i] == newname) {
-                    alert("The new folder may not be named '"+newname+"' as this name is already in use for a system-provided or user-defined folder.");
+                    alert("$lt{'tnfm'} '"+newname+"' $lt{'asth'}");
                     return;
                 }
             }
@@ -569,10 +577,10 @@
                     $result.='<td valign="top">'.
                              '<fieldset><legend><b>'.$lt{$status}.
                              '</b></legend><nobr>'.
-                             '<input type="button" value="check all" '.
+                             '<input type="button" value="'.&mt('Check All').'" '.
                              'onclick="javascript:toggleAll('."'".$status."','check'".')" />'.
                              '&nbsp;&nbsp;'.
-                             '<input type="button" value="uncheck all" '.
+                             '<input type="button" value="'.&mt('Uncheck All').'" '.
                              'onclick="javascript:toggleAll('."'".$status."','uncheck'".')" />'.
                              '</nobr></fieldset><br />'.
                              &Apache::loncommon::start_data_table().
@@ -1147,13 +1155,17 @@
     my $dismsg='';
     my $disbase='';
     my $func=&mt('Send New');
-    my %lt=&Apache::lonlocal::texthash('us' => 'Username',
-				       'do' => 'Domain',
-				       'ad' => 'Additional Recipients',
-				       'sb' => 'Subject',
-				       'ca' => 'Cancel',
-				       'ma' => 'Mail');
-
+    my %lt=&Apache::lonlocal::texthash('us'  => 'Username',
+				       'do'  => 'Domain',
+				       'ad'  => 'Additional Recipients',
+				       'sb'  => 'Subject',
+				       'ca'  => 'Cancel',
+				       'ma'  => 'Mail',
+                                       'gen' => 'Generate messages from a file',
+                                       'gmt' => 'General message text',
+                                       'tff' => 'The file format for the uploaded portion of the message is',
+                                       'uas' => 'Upload and Send',
+                                      );
     if (&Apache::lonnet::allowed('srm',$env{'request.course.id'})
 	|| &Apache::lonnet::allowed('srm',$env{'request.course.id'}.
 				    '/'.$env{'request.course.sec'})) {
@@ -1252,7 +1264,7 @@
     my $latexHelp = Apache::loncommon::helpLatexCheatsheet();
     if ($broadcast ne 'upload') {
        $r->print(<<"ENDCOMP");
-<tr><td>$lt{'ad'}<br /><tt>username:domain,username:domain, ...
+<tr><td>$lt{'ad'}:<br /><tt>username:domain,username:domain, ...
 </tt></td><td>
 <input type="text" size="50" name="additionalrec" /></td></tr>
 <tr><td>$lt{'sb'}:</td><td><input type="text" size="50" name="subject" value="$dissub" />
@@ -1277,31 +1289,34 @@
                       $env{'form.group'}.'" />');
         }
     } else { # $broadcast is 'upload'
-	$r->print(<<ENDUPLOAD);
+	$r->print(<<ENDBLOCK);
 <input type="hidden" name="sendmode" value="upload" />
 <input type="hidden" name="send" value="on" />
-<h3>Generate messages from a file</h3>
+<h3>$lt{'gen'}</h3>
 <p>
 Subject: <input type="text" size="50" name="subject" />
 </p>
-<p>General message text<br />
+<p>$lt{'gmt'}:<br />
 <textarea name="message" id="message" cols="60" rows="10" wrap="hard">$dismsg
 </textarea></p>
 <p>
-The file format for the uploaded portion of the message is:
-<pre>
-username1:domain1: text
-username2:domain2: text
-username3:domain1: text
-</pre>
+$lt{'tff'}:
+ENDBLOCK
+       $r->print('
+<pre>'."\n".
+&mt('username1:domain1: text')."\n".
+&mt('username2:domain2: text')."\n".
+&mt('username3:domain1: text')."\n".
+'</pre>
 </p>
 <p>
-The messages will be assembled from all lines with the respective 
-<tt>username:domain</tt>, and appended to the general message text.</p>
+'.&mt('The messages will be assembled from all lines with the respective'."\n".'<tt>username:domain</tt>, and appended to the general message text.'));
+        $r->print(<<ENDUPLOAD);
+</p>
 <p>
 <input type="file" name="upfile" size="40" /></p><p>
 $dispcrit
-<input type="submit" value="Upload and Send" /></p>
+<input type="submit" value="$lt{'uas'}" /></p>
 ENDUPLOAD
     }
     if ($broadcast eq 'group') {
@@ -1368,7 +1383,7 @@
     if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
 	 && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
 				       '/'.$env{'request.course.sec'})) {
-	$r->print('Not allowed');
+	$r->print(&mt('Not allowed'));
 	return;
     }
     my %records=&Apache::lonnet::dump('nohist_email',
@@ -1450,7 +1465,7 @@
     if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
 	&& ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
 				      '/'.$env{'request.course.sec'})) {
-	$r->print('Not allowed');
+	$r->print(&mt('Not allowed'));
 	return;
     }
     my $crstype = &Apache::loncommon::course_type();
@@ -1537,7 +1552,8 @@
             'cbds' => 'Communication blocking during scheduled exams',
             'desc' => "You can use communication blocking to prevent $usertype enrolled in this course from displaying LON-CAPA messages sent by other $usertype during an online exam. As blocking of communication could potentially interrupt legitimate communication between $usertype who are also both enrolled in a different LON-CAPA course, please be careful that you select the correct start and end times for your scheduled exam when setting or modifying these parameters.",
              'mecb' => 'Modify existing communication blocking periods',
-             'ncbc' => 'No communication blocks currently stored'
+             'ncbc' => 'No communication blocks currently stored',
+             'stor' => 'Store',
     );
 
     my %ltext = &Apache::lonlocal::texthash(
@@ -1576,7 +1592,7 @@
     $r->print(<<"END");
 <br />
 <input type="hidden" name="blocktotal" value="$blockcount" />
-<input type ="submit" value="Save Changes" />
+<input type ="submit" value="$lt{'stor'}" />
 </form>
 $end_page
 END
@@ -1587,10 +1603,6 @@
     my $r = shift;
     my %lt=&Apache::lonlocal::texthash(
             'tfcm' => 'The following changes were made',
-            'cbps' => 'communication blocking period(s)',
-            'werm' => 'was/were removed',
-            'wemo' => 'was/were modified',
-            'wead' => 'was/were added',
             'ncwm' => 'No changes were made.' 
     );
     my %adds = ();
@@ -1647,13 +1659,13 @@
     if ($chgestotal > 0) {
         $r->print($lt{'tfcm'}.'<ul>');
         if ($canceltotal > 0) {
-            $r->print('<li>'.$canceltotal.' '.$lt{'cbps'},' '.$lt{'werm'}.'</li>');
+            $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] removed.',$canceltotal).'</li>');
         }
         if ($modtotal > 0) {
-            $r->print('<li>'.$modtotal.' '.$lt{'cbps'},' '.$lt{'wemo'}.'</li>');
+            $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] modified.',$modtotal).'</li>');
         }
         if ($addtotal > 0) {
-            $r->print('<li>'.$addtotal.' '.$lt{'cbps'},' '.$lt{'wead'}.'</li>');
+            $r->print('<li>'.&mt('[quant,_1,communication blocking period was,communication blocking periods were] added.',$addtotal).'</li>');
         }
         $r->print('</ul>');
     } else {

--raeburn1165589018--