[LON-CAPA-cvs] cvs: loncom /localize/localize de.pm /publisher loncfile.pm

bisitz bisitz@source.lon-capa.org
Tue, 26 May 2009 18:01:44 -0000


This is a MIME encoded message

--bisitz1243360904
Content-Type: text/plain

bisitz		Tue May 26 18:01:44 2009 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
    /loncom/localize/localize	de.pm 
  Log:
  Optimized warning/error styles and Localization:
  - Added warning/error style to some messages
  - Replaced some error styles by warning styles for messages which are more warnings than errors
  - Added filename style to paths/filenames
  - Optimized &mt calls for Copy/Move/Rename/Decompress operations
  - Added full stops to full sentences
  - Adjusted and added corresponding phrases in de.pm
  
  
  
--bisitz1243360904
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20090526180144.txt"

Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.99 loncom/publisher/loncfile.pm:1.100
--- loncom/publisher/loncfile.pm:1.99	Tue May 26 16:29:56 2009
+++ loncom/publisher/loncfile.pm	Tue May 26 18:01:39 2009
@@ -9,7 +9,7 @@
 #  and displays a page showing the results of the action.
 #
 #
-# $Id: loncfile.pm,v 1.99 2009/05/26 16:29:56 bisitz Exp $
+# $Id: loncfile.pm,v 1.100 2009/05/26 18:01:39 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -361,25 +361,28 @@
 	my ($newpath)=($dest=~m|(.*)/|);
 	$newpath=&relativeDest($fn,$newpath,$uname);
 	if (! -d "$newpath") {
-	    $request->print('<p><span class="LC_error">'
+	    $request->print('<p><span class="LC_warning">'
                            .&mt("You have requested to create file in directory [_1] which doesn't exist. The requested directory path has been removed from the requested file name."
-                               ,'"'.&display($newpath).'"')
+                               ,'<span class="LC_filename">'.&display($newpath).'</span>')
                            .'</span></p>');
 	    $dest=~s|.*/||;
 	}
     }
     if ($dest =~ /\.(\d+)\.(\w+)$/){
-	$request->print('<span class="LC_error">'
+	$request->print('<p><span class="LC_warning">'
 			.&mt('Bad filename [_1]','<span class="LC_filename">'.&display($dest).'</span>')
                         .'<br />'
                         .&mt('[_1](name).(number).(extension)[_2] not allowed.','<tt>','</tt>')
                         .'<br />'
                         .&mt('Removing the [_1].number.[_2] from requested filename.','<tt>','</tt>')
-			.'</span>');
+			.'</span></p>');
 	$dest =~ s/\.(\d+)(\.\w+)$/$2/;
     }
     if ($foundbad) {
-	$request->print("<p><span class=\"LC_error\">".&mt('Invalid characters in requested name have been removed.')."</span></p>");
+        $request->print('<p><span class="LC_warning">'
+                       .&mt('Invalid characters in requested name have been removed.')
+                        .'</span></p>'
+        );
     }
     return $dest;
 }
@@ -514,10 +517,10 @@
 	    if (-d $fn) {
 		$newfilename=~/\.(\w+)$/;
 		if (&Apache::loncommon::fileembstyle($1) eq 'ssi') {
-		    $request->print('<br /><span classr="LC_warning">'.
-				    &mt('Cannot change MIME type of a directory').
+		    $request->print('<p><span class="LC_error">'.
+				    &mt('Cannot change MIME type of a directory.').
 				    '</span>'.
-				    '<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');
+				    '<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a></p>');
 		    return;
 		}
 		$newfilename=~s/\/[^\/]+\/([^\/]+)$/\/$1/;
@@ -533,27 +536,37 @@
 		return;
 	    }
 	    unless (&obsolete_unpub($user,$domain,$fn)) {
-		$request->print('<h3>'.&mt('Cannot rename or move non-obsolete published file').'</h3>'.
-				'<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');
+                $request->print('<p><span class="LC_error">'
+                               .&mt('Cannot rename or move non-obsolete published file.')
+                               .'</span><br />'
+                               .'<a href="'.&url($fn).'">'.&mt('Cancel').'</a></p>'
+                );
 		return;
 	    }
 	    my $action;
 	    if ($style eq 'rename') {
-		$action=&mt('Rename');
+		$action='Rename';
 	    } else {
-		$action=&mt('Move');
+		$action='Move';
 	    }
-	    $request->print('<input type="hidden" name="newfilename" value="'.
-			    $newfilename.
-			    '" /><p>'.$action.' '.&display($fn).
-			    '</p><br />to '.&display($newfilename).'?</p>');
+            $request->print('<input type="hidden" name="newfilename" value="'
+                           .$newfilename.'" />'
+                           .'<p>'
+                           .&mt($action.' [_1] to [_2]?'
+                               ,&display($fn),&display($newfilename))
+                           .'</p>'
+        );
 	    &CloseForm1($request, $fn);
 	} else {
-	    $request->print('<p>'.&mt('No new filename specified.').'</p></form>');
+	    $request->print('<p class="LC_error">'.&mt('No new filename specified.').'</p></form>');
 	    return;
 	}
     } else {
-	$request->print('<p> '.&mt('No such file').': '.&display($fn).'</p></form>');
+        $request->print('<p class="LC_error">'
+                       .&mt('No such file: [_1]'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>')
+                       .'</p></form>'
+        );
 	return;
     }
     
@@ -591,22 +604,38 @@
 			$fn.'" />');
         if (-d $fn) {
             unless (&empty_directory($fn,'Delete1')) {
-                $request->print('<h3>'.&mt('Only empty directories may be deleted.').'</h3>'.
-                            'You must delete the contents of the directory first.<br />'.
-                            '<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');
+                $request->print('<p>'
+                               .'<span class="LC_error">'
+                               .&mt('Only empty directories may be deleted.')
+                               .'</span><br />'
+                               .&mt('You must delete the contents of the directory first.')
+                               .'</p>'
+                               .'<p><a href="'.&url($fn).'">'.&mt('Cancel').'</a></p>'
+                );
                 return;
             }
         } else { 
 	    unless (&obsolete_unpub($user,$domain,$fn)) {
-	        $request->print('<h3>'.&mt('Cannot delete non-obsolete published file').'</h3>'.
-			    '<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');
+                $request->print('<p><span class="LC_error">'
+                               .&mt('Cannot delete non-obsolete published file.')
+                               .'</span><br />'
+                               .'<a href="'.&url($fn).'">'.&mt('Cancel').'</a></p>'
+                );
 	        return;
 	    }
         }
-	$request->print('<p>'.&mt('Delete').' '.&display($fn).'?</p>');
+        $request->print('<p>'
+                       .&mt('Delete [_1]?'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>')
+                       .'</p>'
+        );
 	&CloseForm1($request, $fn);
     } else {
-	$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>');
+        $request->print('<p class="LC_error">'
+                       .&mt('No such file: [_1]'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>')
+                       .'</p></form>'
+        );
     }
 }
 
@@ -660,13 +689,21 @@
 	    $request->print('<br /><a href="'.&url($fn).'">'.&mt('Cancel').'</a>');
 	    return;
 	}
-	$request->print('<input type="hidden" name="newfilename" value="'.
-			$newfilename.
-			'" /><p>'.&mt('Copy').' '.&display($fn).'<br />to '.
-			&display($newfilename).'?</p>');
+        $request->print('<input type="hidden" name="newfilename" value="'
+                       .$newfilename.'" />'
+                       .'<p>'
+                       .&mt('Copy [_1] to [_2]?'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>'
+                           ,'<span class="LC_filename">'.&display($newfilename).'</span>')
+                       .'</p>'
+        );
 	&CloseForm1($request, $fn);
     } else {
-	$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>');
+        $request->print('<p class="LC_error">'
+                       .&mt('No such file: [_1]'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>')
+                       .'</p></form>'
+        );
     }
 }
 
@@ -722,9 +759,13 @@
 	} elsif ($mode eq 'imsimport') {
 	    $request->print('<input type="hidden" name="callingmode" value="imsimport" />');
 	}
-	$request->print('<input type="hidden" name="newfilename" value="'.
-			$newfilename.'" /><p>'.&mt('Make new directory').' '.
-			&display($newfilename).'?</p>');
+        $request->print('<input type="hidden" name="newfilename" value="'
+                       .$newfilename.'" />'
+                       .'<p>'
+                       .&mt('Make new directory [_1]?'
+                           ,'<span class="LC_filename">'.&display($newfilename).'</span>')
+                       .'</p>'
+        );
 	&CloseForm1($request, $fn);
     }
 }
@@ -734,10 +775,18 @@
     my ($request, $user, $domain, $fn) = @_;
     if( -e $fn) {
    	$request->print('<input type="hidden" name="newfilename" value="'.$fn.'" />');
-   	$request->print('<p>'.&mt('Decompress').' '.&display($fn).'?</p>');
+   	$request->print('<p>'
+                   .&mt('Decompress [_1]?'
+                       ,'<span class="LC_filename">'.&display($fn).'</span>')
+                   .'</p>'
+    );
    	&CloseForm1($request, $fn);
     } else {
-	$request->print('<p>'.&mt('No such file').': '.&display($fn).'</p></form>');
+        $request->print('<p class="LC_error">'
+                       .&mt('No such file: [_1]'
+                           ,'<span class="LC_filename">'.&display($fn).'</span>')
+                       .'</p></form>'
+        );
     }
 }
 
@@ -905,7 +954,10 @@
 	if($newfilename) {
 	    &Copy1($r, $uname, $udom, $fn, $newfilename);
 	} else {
-	    $r->print('<p>'.&mt('No new filename specified.').'</p></form>');
+            $r->print('<p class="LC_error">'
+                     .&mt('No new filename specified.')
+                     .'</p></form>'
+            );
 	}
     } elsif ($env{'form.action'} eq 'newdir') {
 	my $mode = '';
@@ -927,7 +979,10 @@
 	if (($newfilename!~/\/$/) && ($newfilename!~/$empty$/)) {
 	    &NewFile1($r, $uname, $udom, $fn, $newfilename);
 	} else {
-	    $r->print('<p>'.&mt('No new filename specified.').'</p></form>');
+            $r->print('<p class="LC_error">'
+                     .&mt('No new filename specified.')
+                     .'</p></form>'
+            );
 	}
     }
 }
@@ -1014,7 +1069,11 @@
 	    unlink $tmp2;
 	}
     } else {
-	$request->print("<p> ".&mt('No such file').": ".&display($oldfile).'</p></form>');
+        $request->print('<p>'
+                       .&mt('No such file: [_1]'
+                           ,'<span class="LC_filename">'.&display($oldfile).'</span>')
+                       .'</p></form>'
+        );
 	return 0;
     }
     return 1;
@@ -1062,7 +1121,7 @@
 		    return 0;
 		}
 	    } else {
-		$request->print('<p> '.&mt('No such file').'. </p></form>');
+        	$request->print('<p class="LC_error">'.&mt('No such file').'</p></form>');
 		return 0;
 	    }
 	}
@@ -1073,7 +1132,7 @@
 		return 0;
 	    }
 	} else {
-	    $request->print('<p> '.&mt('No such file').'. </p></form>');
+            $request->print('<p class="LC_error">'.&mt('No such file').'</p></form>');
 	    return 0;
 	}
     }
@@ -1132,7 +1191,7 @@
 	    return 1;
 	}
     } else {
-	$request->print('<p> '.&mt('No such file').' </p>');
+        $request->print('<p class="LC_error">'.&mt('No such file').'</p>');
 	return 0;
     }
     return 1;
@@ -1286,7 +1345,7 @@
 	    }
 	    $dest = $env{'form.newfilename'};
      	} else {
-	    $r->print('<p>'.&mt('No New filename specified').'</p></form>');
+            $r->print('<p class="LC_error">'.&mt('No New filename specified').'</p></form>');
 	    return;
 	}
 	
@@ -1442,8 +1501,11 @@
 	     $env{'form.action'} eq 'Select Action' ) {
 	$r->print('<h3>'.&mt('New Resource').'</h3>');
     } else {
-	$r->print('<p>'.&mt('Unknown Action').' '.$env{'form.action'}.' </p>'.
-		  &Apache::loncommon::end_page());
+        $r->print('<p class="LC_error">'
+                 .&mt('Unknown Action').' '.$env{'form.action'}
+                 .'</p>'
+                 .&Apache::loncommon::end_page()
+        );
 	return OK;  
     }
     if ($env{'form.phase'} eq 'two') {
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.304 loncom/localize/localize/de.pm:1.305
--- loncom/localize/localize/de.pm:1.304	Wed May 20 13:55:50 2009
+++ loncom/localize/localize/de.pm	Tue May 26 18:01:44 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.304 2009/05/20 13:55:50 bisitz Exp $
+# $Id: de.pm,v 1.305 2009/05/26 18:01:44 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3989,8 +3989,8 @@
    'Logout'
 => 'Logout',
 
-   'Make new directory'
-=> 'Neues Verzeichnis erstellen',
+   'Make new directory [_1]?'
+=> 'Neues Verzeichnis [_1] erstellen?',
 
    'Make new file'
 => 'Neue Datei erstellen',
@@ -4101,7 +4101,10 @@
 => 'Kein neuer Dateiname angegeben.',
 
    'No such file'
-=> 'Datei nicht gefunden',
+=> 'Datei existiert nicht',
+
+   'No such file: [_1]'
+=> 'Die Datei [_1] existiert nicht.',
 
    'Not Allowed'
 => 'Nicht zulässig',
@@ -8645,6 +8648,9 @@
    'Choose file type:'
 => 'Dateityp:',
 
+   'Decompress [_1]?'
+=> '[_1] entpacken?',
+
    'Output of decompress:'
 => 'Ausgabe des Entpackvorgangs:',
 
@@ -10309,7 +10315,7 @@
    'You must delete the contents of the directory first.'
 => 'Sie müssen zunächst die Inhalte aus dem Verzeichnis entfernen.',
 
-   'Cannot delete non-obsolete published file'
+   'Cannot delete non-obsolete published file.'
 => 'Veröffentlichte, aber nicht als überholt gekennzeichnete Dateien können nicht gelöscht werden.',
 
    'Must not include'
@@ -10342,11 +10348,11 @@
    'Removing the [_1].number.[_2] from requested filename.'
 => '[_1].Zahl.[_2] wurde aus dem angeforderten Dateinamen entfernt.',
 
-   'Cannot change MIME type of a directory'
-=> 'Der MIME-Typ eines Verzeichnisses kann nicht geändert werden',
+   'Cannot change MIME type of a directory.'
+=> 'Der MIME-Typ eines Verzeichnisses kann nicht geändert werden.',
 
-   'Cannot rename or move non-obsolete published file'
-=> 'Veröffentlichte, aber nicht als überholt gekennzeichnete Dateien können nicht umbenannt oder verschoben werden',
+   'Cannot rename or move non-obsolete published file.'
+=> 'Veröffentlichte, aber nicht als überholt gekennzeichnete Dateien können nicht umbenannt oder verschoben werden.',
 
    'Change discussion display'
 => 'Anzeige von Diskussionen ändern',
@@ -12827,6 +12833,12 @@
    'Rename [_1] to [_2]?'
 => '[_1] in [_2] umbenennen?',
 
+   'Move [_1] to [_2]?'
+=> '[_1] nach [_2] verschieben?',
+
+   'Copy [_1] to [_2]?'
+=> '[_1] nach [_2] kopieren?',
+
    'Reference Warning'
 => 'Verweiswarnung',
 
@@ -16301,7 +16313,7 @@
 => 'Die Belegungsgrenze von [quant,_1,selbsteingetragenen Studenten,selbsteingetragenen Studenten] wurde erreicht.',
 
    'A self-enrollment request already exists for you for this course.'
-=> 'Für Sie exisitiert bereits ein Selbsteintragungswunsch für diesen Kurs.',
+=> 'Für Sie existiert bereits ein Selbsteintragungswunsch für diesen Kurs.',
 
    'Your earlier request was submitted: [_1] and remains in a queue awaiting action by a Course Coordinator.'
 => 'Ihr vorheriger Wunsch wurde am [_1] abgeschickt und verbleibt in der Warteschlange, um vom Kurs-Koordinator abgearbeitet zu werden.',

--bisitz1243360904--