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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Thu, 20 Nov 2008 16:32:40 -0000


bisitz		Thu Nov 20 16:32:40 2008 EDT

  Modified files:              
    /loncom/publisher	lonupload.pm 
    /loncom/localize/localize	de.pm 
  Log:
  - Localization: Optimized &mt() usage
  - Optimized error message display (use <p> tag)
  
  
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.40 loncom/publisher/lonupload.pm:1.41
--- loncom/publisher/lonupload.pm:1.40	Tue Nov 18 19:14:40 2008
+++ loncom/publisher/lonupload.pm	Thu Nov 20 16:32:34 2008
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Handler to upload files into construction space
 #
-# $Id: lonupload.pm,v 1.40 2008/11/18 19:14:40 jms Exp $
+# $Id: lonupload.pm,v 1.41 2008/11/20 16:32:34 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,10 +184,11 @@
 		      '<input type="hidden" name="datatoken" value="'.
 		      &upfile_store.'" />'.
 		      '<input type="hidden" name="uploaduname" value="'.$uname.
-		      '" />'.&mt('Save uploaded file as ').
+		      '" />'.&mt('Save uploaded file as [_1]',
                       "<span class='LC_filename'>/priv/$uname/</span>".
                       '<input type="text" size="50" name="filename" value="'.$fn.
-                      '" /><br />'.
+                      '" />').
+                      '<br />'.
 		      '<br />'.&mt('Choose file type:').'
 <select name="filetype">
  <option value="standard" selected>'.&mt('Regular file').'
@@ -201,15 +202,16 @@
 	    # Check for bad extension and warn user
 	    if ($fn=~/\.(\w+)$/ && 
 		(&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
-		$r->print('<span class="LC_error">'.&mt('The extension on this file,').
-			  ' "'.$1.'"'.&mt(', is reserved internally by LON-CAPA.').
-			  ' <br />'.&mt('Please change the extension.').'</span>');
+                $r->print('<p class="LC_error">'
+                          .&mt('The extension on this file, [_1], is reserved internally by LON-CAPA.','"'.$1.'"')
+                          .' <br />'.&mt('Please change the extension.')
+                          .'</p>');
 	    } elsif($fn=~/\.(\w+)$/ && 
 		    !defined(&Apache::loncommon::fileembstyle($1))) {
-		$r->print('<span class="LC_error">'.&mt('The extension on this file,').
-			  ' "'.$1.'"'.&mt(', is not recognized by LON-CAPA.').
-			  ' <br />'.&mt('Please change the extension.').
-			  '</span>');
+                $r->print('<p class="LC_error">'
+                         .&mt('The extension on this file, [_1], is not recognized by LON-CAPA.','"'.$1.'"')
+                         .' <br />'.&mt('Please change the extension.')
+                         .'</p>');
 	    }
 	} else {
 	    $r->print('<span class="LC_error">'.&mt('Illegal filename.').'</span>');
@@ -288,23 +290,23 @@
     if ($fn=~/\.(\w+)$/ &&
         (&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
         $result .= &mt('File [_1] could not be copied.',
-                      '<span class="LC_filename">'.$fn.'</span> ').
-                  '<br /><span class="LC_error">'.
+                      '<p class="LC_filename">'.$fn.'</span> ').
+                  '<span class="LC_error">'.
                   &mt('The extension on this file is reserved internally by LON-CAPA.').
-                  '</span>';
+                  '</p>';
     } elsif ($fn=~/\.(\w+)$/ &&
              !defined(&Apache::loncommon::fileembstyle($1))) {
         $result .= &mt('File [_1] could not be copied.',
                       '<span class="LC_filename">'.$fn.'</span> ').
-                  '<br /><span class="LC_error">'.
+                  '<p class="LC_error">'.
                   &mt('The extension on this file is not recognized by LON-CAPA.').
-                  '</span>';
+                  '</p>';
     } elsif (-d $target) {
         $result .= &mt('File [_1] could not be copied.',
                       '<span class="LC_filename">'.$fn.'</span>').
-                  '<br /><span class="LC_error">'.
+                  '<p class="LC_error">'.
                   &mt('The target is an existing directory.').
-                  '</span>';
+                  '</p>';
     } elsif (copy($source,$target)) {
         chmod(0660, $target); # Set permissions to rw-rw---.
         if ($mode eq 'testbank' || $mode eq 'imsimport') {
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.156 loncom/localize/localize/de.pm:1.157
--- loncom/localize/localize/de.pm:1.156	Fri Nov  7 18:00:48 2008
+++ loncom/localize/localize/de.pm	Thu Nov 20 16:32:39 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # German Localization Lexicon
 #
-# $Id: de.pm,v 1.156 2008/11/07 18:00:48 bisitz Exp $
+# $Id: de.pm,v 1.157 2008/11/20 16:32:39 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -713,14 +713,14 @@
    'Empty'
 => 'Leer',
 
-   'could not be copied.'
-=> 'konnte nicht kopiert werden.',
+   'File [_1] could not be copied.'
+=> 'Die Datei [_1] konnte nicht kopiert werden.',
 
    'Back to Directory'
 => 'Zurück zum Verzeichnis',
 
    'No upload file specified.'
-=> 'Keine Datei zum Hochladen angegeben.',
+=> 'Es wurde keine Datei zum Hochladen angegeben.',
 
    'The target is an existing directory.'
 => 'Die Zieldatei ist ein existierendes Verzeichnis.',
@@ -761,8 +761,8 @@
    'Please log into [_1] to edit.'
 => 'Bitte melden Sie sich in der Domäne [_1] an, um Zugriff zu erhalten.',
 
-   'Save uploaded file as '
-=> 'Speichere hochgeladene Datei unter ',
+   'Save uploaded file as [_1]'
+=> 'Hochgeladene Datei speichern unter [_1]',
 
    'Searching'
 => 'Suche',
@@ -875,9 +875,6 @@
    'View file'
 => 'Datei betrachten',
 
-   'could not be copied.'
-=> 'konnte nicht kopiert werden.',
-
    'Illegal filename.'
 => 'Ungültiger Dateiname.',
 
@@ -902,8 +899,20 @@
    'untitled'
 => 'kein Titel',
 
-   ', is reserved internally by LON-CAPA.'
-=> ', ist intern reserviert für LON-CAPA.',
+   'The extension on this file, [_1], is reserved internally by LON-CAPA.'
+=> 'Die Dateiendung [_1] ist LON-CAPA-intern reserviert.',
+
+   'The extension on this file is reserved internally by LON-CAPA.'
+=> 'Die Dateiendung ist LON-CAPA-intern reserviert.',
+
+   'The extension on this file, [_1], is not recognized by LON-CAPA.'
+=> 'Die Dateiendung [_1] ist LON-CAPA unbekannt.',
+
+   'The extension on this file is not recognized by LON-CAPA.'
+=> 'Die Dateiendung [_1] ist LON-CAPA unbekannt.',
+
+   'Please change the extension.'
+=> 'Bitte ändern Sie die Dateiendung.',
 
    'Became this version on ...'
 => 'Wurde diese Version am...',
@@ -4743,8 +4752,8 @@
    'only check if you know what you are doing'
 => 'nur auswählen, wenn Sie wissen, was Sie tun',
 
-   '[_1] only search domain [_2]'
-=> '[_1] suche nur in Domäne [_2]',
+   '[_1] only search domain [_2]' # 1: checkbox, 2: domain
+=> '[_1] Nur in Domäne [_2] suchen',
 
    'optional'
 => 'optional',