[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm imsimportdocs.pm /localize/localize de.pm
bisitz
bisitz at source.lon-capa.org
Mon Sep 30 13:42:18 EDT 2013
bisitz Mon Sep 30 17:42:18 2013 EDT
Modified files:
/loncom/imspackages imsimport.pm imsimportdocs.pm
/loncom/localize/localize de.pm
Log:
- Internationalization and Localization:
Added missing &mt() calls and added related phrases and translations to de.pm
- Consistent wording and punctuation
- Consistent and improved layout using confirm_success and actionbox
- Added error handling for failed IMS package upload
-------------- next part --------------
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.44 loncom/imspackages/imsimport.pm:1.45
--- loncom/imspackages/imsimport.pm:1.44 Mon Sep 23 17:35:05 2013
+++ loncom/imspackages/imsimport.pm Mon Sep 30 17:42:12 2013
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimport.pm,v 1.44 2013/09/23 17:35:05 bisitz Exp $
+# $Id: imsimport.pm,v 1.45 2013/09/30 17:42:12 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -133,6 +133,20 @@
$course_list = '"'.join('","', at crslist).'"';
$$numcrs = @crslist;
+ my %lt = &Apache::lonlocal::texthash(
+ sel => 'Please select',
+ impto => 'Import topics only',
+ imptpa => 'Import topics + posts (with author)',
+ imptpn => 'Import topics + posts (no author)',
+ enrst => 'Enroll students only',
+ enrall => 'Enroll all users',
+ notreq => 'Not required',
+ errao => 'You must select one of the additional options when importing Discussion Boards.',
+ errtd => 'You must select a target course when importing Discussion Boards.',
+ errap => 'You must select one of the additional options when importing Enrollment.',
+ errte => 'You must select a target course when importing enrollment information.',
+ errcc => 'You must check at least one Content Type.',
+ );
return <<"END_OF_TWO";
function checkCourse() {
@@ -181,7 +195,7 @@
step2Form.targetcourse.length = 0
if (call == 'add') {
step2Form.targetcourse.length = 0
- step2Form.targetcourse.options[0] = new Option("Please Select","0",true,true)
+ step2Form.targetcourse.options[0] = new Option("$lt{'sel'}","0",true,true)
for (var i=0; i<courseID_array.length; i++) {
step2Form.targetcourse.options[i+1] = new Option(courseTitle_array[i],courseID_array[i],false,false)
}
@@ -201,22 +215,22 @@
opForm.elements[menu].length = 0
if (opForm.elements[itemnum*2].checked == true) {
if (caller == "board") {
- opForm.elements[menu].options[0] = new Option("Select","-1",true,true)
- opForm.elements[menu].options[1] = new Option("Import topics only","topics",true,true)
- opForm.elements[menu].options[2] = new Option("Import topics + posts (with author)","allpost",true,true)
- opForm.elements[menu].options[3] = new Option("Import topics + posts (no author)","allanon",true,true)
+ opForm.elements[menu].options[0] = new Option("$lt{'sel'}","-1",true,true)
+ opForm.elements[menu].options[1] = new Option("$lt{'impto'}","topics",true,true)
+ opForm.elements[menu].options[2] = new Option("$lt{'imptpa'}","allpost",true,true)
+ opForm.elements[menu].options[3] = new Option("$lt{'imptpn'}","allanon",true,true)
}
else {
if (caller == "users") {
opForm.elements[menu].length = 0
- opForm.elements[menu].options[0] = new Option("Select","-1",true,true)
- opForm.elements[menu].options[1] = new Option("Enroll students only","students",true,true)
- opForm.elements[menu].options[2] = new Option("Enroll all users","all",true,true)
+ opForm.elements[menu].options[0] = new Option("$lt{'sel'}","-1",true,true)
+ opForm.elements[menu].options[1] = new Option("$lt{'enrst'}","students",true,true)
+ opForm.elements[menu].options[2] = new Option("$lt{'enrall'}","all",true,true)
}
}
}
else {
- opForm.elements[menu].options[0] = new Option("Not required","0",true,true)
+ opForm.elements[menu].options[0] = new Option("$lt{'notreq'}","0",true,true)
}
opForm.elements[menu].selectedIndex = 0
if (numCrs > 0) {
@@ -234,7 +248,7 @@
totcheck ++
if (opForm.elements[2*i].name == "board") {
if (opForm.elements[2*i+1].selectedIndex == 0) {
- alert("You must select one of the additional options when importing Discussion Boards ")
+ alert("$lt{'errao'}")
return false
}
if (numCrs == 0) {
@@ -243,14 +257,14 @@
}
else {
if (opForm.targetcourse.selectedIndex == 0) {
- alert("You must select a target course when importing Discussion Boards")
+ alert("$lt{'errtd'}")
return false
}
}
}
if (opForm.elements[2*i].name == "users") {
if (opForm.elements[2*i+1].selectedIndex == 0) {
- alert("You must select one of the additional options when importing Enrollment")
+ alert("$lt{'errap'}")
return false
}
if (numCrs == 0) {
@@ -259,7 +273,7 @@
}
else {
if (opForm.targetcourse.selectedIndex == 0) {
- alert("You must select a target course when importing enrollment information")
+ alert("$lt{'errte'}")
return false
}
}
@@ -267,7 +281,7 @@
}
}
if (totcheck == 0) {
- alert("You must check the Checkbox for at least one Content Type");
+ alert("$lt{'errcc'}");
return false
}
return true
@@ -290,7 +304,7 @@
&Apache::lonhtmlcommon::topic_bar(1,&mt('Specify the Course Management system used to create the package')).
&mt('Choose the CMS used to create your IMS content package.').'
<select name="source">
- <option value="-1" selected="selected">Please select</option>
+ <option value="-1" selected="selected">'.&mt('Please select').'</option>
<option value="bb5">Blackboard 5</option>
<option value="bb6">Blackboard 6</option>
<option value="angel5">ANGEL 5.5</option>
@@ -298,7 +312,7 @@
<option value="webctvista4">WebCT Vista 4</option>
</select><br />'."\n".
&Apache::lonhtmlcommon::topic_bar(2,&mt('Create a directory where you will unpack your IMS package'))."\n".
- &mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').' <input type="button" name="createdir" value="Create Directory" onclick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /><br /><br />
+ &mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').' <input type="button" name="createdir" value="'.&mt('Create Directory').'" onclick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /><br /><br />
<input type="hidden" name="filename" value="'.$fn.'" />
<input type="hidden" name="phase" value="three" />
<input type="button" name="nextpage" value="'.&mt('Proceed').'" onclick="javascript:nextPage();" />
@@ -465,7 +479,11 @@
$r->print($lt{'unpa'});
}
} else {
- $r->print($lt{'proc'});
+ $r->print(
+ '<br />'.&Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success($lt{'proc'},1)
+ .'<br />'.&mt('Error: [_1]',$unzip_result))
+ );
}
}
@@ -598,20 +616,32 @@
&Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$dirpath,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);
- $r->print("<h3>IMS import completed</h3>");
+ my $message =
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('IMS import completed'))
+ .'<br />'.$lt{'yims'}.' ';
if ($cms eq 'angel5') {
- $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,discussion board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n");
+ $message .= &mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,discussion board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n";
} else {
- $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,discussion board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n");
+ $message .= &mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,discussion board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n";
}
- $r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$udom.'/'.$uname.'/'.$dirpath.'/">'.$lt{'disp'}.'</a>');
+ $r->print(
+ '<br />'.&Apache::loncommon::confirmwrapper($message)
+ .'<p>'.$lt{'plsv'}.' '.$lt{'tseq'}.'</p>'
+ .'<p>'.$lt{'tfin'}.'</p>'
+ .&Apache::lonhtmlcommon::actionbox(
+ ['<a href="/priv/'.$udom.'/'.$uname.'/'.$dirpath.'/">'.$lt{'disp'}.'</a>'])
+ );
my $londocroot = $r->dir_config('lonDocRoot');
if ($destdir =~ m{^\Q$londocroot/priv/$udom/$uname/$dirpath\E}) {
system (" rm -r -f $destdir/temp");
}
} elsif ($manifest_result eq 'nomanifest') {
- $r->print($lt{'proc'});
+ $r->print(
+ '<br />'.&Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success($lt{'proc'},1))
+ );
}
}
@@ -749,6 +779,12 @@
my $flag = &Apache::lonupload::phasetwo($r,$fn,'imsimport');
if ($flag eq 'ok') {
&display_one($r,$fn,$fullpath,$formname_one);
+ } else {
+ $r->print(
+ '<br />'.&Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Error uploading IMS package'),1))
+ );
}
} elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) {
my $destdir = $env{'form.newdir'};
Index: loncom/imspackages/imsimportdocs.pm
diff -u loncom/imspackages/imsimportdocs.pm:1.31 loncom/imspackages/imsimportdocs.pm:1.32
--- loncom/imspackages/imsimportdocs.pm:1.31 Sat Jul 27 22:04:49 2013
+++ loncom/imspackages/imsimportdocs.pm Mon Sep 30 17:42:12 2013
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimportdocs.pm,v 1.31 2013/07/27 22:04:49 raeburn Exp $
+# $Id: imsimportdocs.pm,v 1.32 2013/09/30 17:42:12 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,9 +48,9 @@
es => 'Enroll students only',
ea => 'Enroll all users',
nr => 'Not required',
- id => 'You must select one of the additional options when importing Disussion Boards',
- ie => 'You must select one of the additional options when importing Enrollment',
- ct => 'You must check at least one Content Type',
+ id => 'You must select one of the additional options when importing Discussion Boards.',
+ ie => 'You must select one of the additional options when importing Enrollment.',
+ ct => 'You must check at least one Content Type.',
);
return <<"ENDJS";
function setOptions(caller,itemnum) {
@@ -225,10 +225,11 @@
if ($unzip_result ne 'ok') {
$r->print(
- '<p class="LC_warning">'
- .&mt('Processing of your IMS package failed because the file you'
- .' uploaded could not be unzipped.')
- .'</p>'
+ &Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Processing of your IMS package failed because the file you'
+ .' uploaded could not be unzipped.'),1)
+ .'<br />'.&mt('Error: [_1]',$unzip_result))
);
return();
}
@@ -239,9 +240,10 @@
\%resinfo,'choose',\%includedres,\%includeditems);
if ($manifest_result ne 'ok') {
$r->print(
- '<p class="LC_warning">'
- .&mt('Unpacking of your IMS package failed because an IMS manifest file was not located in the package.')
- .'</p>'
+ '<br />'.&Apache::loncommon::confirmwrapper(
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Unpacking of your IMS package failed because an IMS manifest file'
+ .' was not located in the package.'),1))
);
return();
}
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.546 loncom/localize/localize/de.pm:1.547
--- loncom/localize/localize/de.pm:1.546 Fri Sep 27 13:55:14 2013
+++ loncom/localize/localize/de.pm Mon Sep 30 17:42:18 2013
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.546 2013/09/27 13:55:14 bisitz Exp $
+# $Id: de.pm,v 1.547 2013/09/30 17:42:18 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -11685,6 +11685,9 @@
'Directory'
=> 'Verzeichnis',
+ 'Create Directory'
+=> 'Verzeichnis erstellen',
+
'Only empty directories may be deleted.'
=> 'Es können nur leere Verzeichnisse gelöscht werden.',
@@ -15729,6 +15732,9 @@
'Error uploading new folder.'
=> 'Fehler beim Hochladen des neuen Verzeichnisses.',
+ 'Error uploading IMS package'
+=> 'Fehler beim Hochladen des IMS-Pakets',
+
'Error reading contents of parent folder.'
=> 'Fehler beim Lesen der Inhalte des übergeordneten Verzeichnisses.',
@@ -23323,7 +23329,7 @@
=> 'Erstellung eines Verzeichnisses, in dem Sie Ihr IMS-Paket entpacken können',
'Display new directory'
-=> 'Neues Verzeichnis anzeigen',
+=> 'Das neue Verzeichnis anzeigen',
'Enter the name of the new directory where you will store the contents of your IMS package.'
=> 'Geben Sie den Namen des neuen Verzeichnisses ein, in dem die Inhalte Ihres IMS-Pakets gespeichert werden sollen.',
@@ -23347,7 +23353,7 @@
=> 'Bitte [_1]erneut starten[_2].',
'Please view the imported items and use the LON-CAPA editing tools to make changes.'
-=> 'Bitte schauen Sie sich die importieren Elemente an und verwenden Sie die in LON-CAPA integrierten Bearbeitungswerkzeuge, um ggf. Ãnderungen vorzunehmen.',
+=> 'Bitte schauen Sie sich die importierten Elemente an und verwenden Sie die in LON-CAPA integrierten Bearbeitungswerkzeuge, um ggf. Ãnderungen vorzunehmen.',
'Sorry, your authentication has expired.'
=> 'Ihre Authentifizierung ist abgelaufen.',
@@ -25285,15 +25291,21 @@
'Import topics only'
=> 'Nur Themen importieren',
- 'You must check at least one Content Type'
+ 'You must check at least one Content Type.'
=> 'Sie müssen mindestens einen Inhaltstypen auswählen.',
- 'You must select one of the additional options when importing Disussion Boards'
+ 'You must select one of the additional options when importing Discussion Boards.'
=> 'Um Diskussionsforen importieren zu können, müssen Sie eine der zusätzlichen Optionen auswählen.',
- 'You must select one of the additional options when importing Enrollment'
+ 'You must select one of the additional options when importing Enrollment.'
=> 'Um Kursbelegungen importieren zu können, müssen Sie eine der zusätzlichen Optionen auswählen.',
+ 'You must select a target course when importing enrollment information.'
+=> 'Um Kursbelegungs-Informationen importieren zu können, müssen Sie eine der zusätzlichen Optionen auswählen.',
+
+ 'You must select a target course when importing Discussion Boards.'
+=> 'Um Diskussionsforen importieren zu können, müssen Sie einen Zielkurs auswählen.',
+
'Other css'
=> 'Anderes CSS',
@@ -27613,7 +27625,7 @@
=> 'erwartete Version',
'IMS Upload'
-=> 'IMS-Hochladen',
+=> 'IMS-Paket hochladen',
'Upload Content'
=> 'Inhalt hochladen',
@@ -28053,6 +28065,9 @@
'You do not have active course coordinator status in any LON-CAPA courses currently, so discussion boards and enrollment information included in your IMS package will be discarded, regardless of your import choice for these two items above (step 3).'
=> 'Sie haben in keinem LON-CAPA-Kurs eine aktive Kurs-Koordinatoren-Rolle. Daher werden Diskussionsforen und Kursbelegungs-Informationen in Ihrem IMS-Paket verworfen, unabhängig von Ihrer getroffenen Import-Auswahl für diese beiden Elemente (Schritt 3).',
+ 'IMS import completed'
+=> 'IMS-Import abgeschlossen',
+
#SYNCMARKER
);
1;
More information about the LON-CAPA-cvs
mailing list