internationalize Asset export report

This commit is contained in:
Colin Kuskie 2005-10-16 04:21:31 +00:00
parent 47b95413f4
commit 20a36e272e
2 changed files with 28 additions and 8 deletions

View file

@ -230,9 +230,9 @@ sub www_exportGenerate {
my $assets = $self->getLineage(["self","descendants"],{returnObjects=>1,endingLineageLength=>$self->getLineageLength+$session{form}{depth}}); my $assets = $self->getLineage(["self","descendants"],{returnObjects=>1,endingLineageLength=>$self->getLineageLength+$session{form}{depth}});
foreach my $asset (@{$assets}) { foreach my $asset (@{$assets}) {
my $url = $asset->get("url"); my $url = $asset->get("url");
print WebGUI::International::get('exporting page', 'Asset').' '.$url."......"; printf WebGUI::International::get('exporting page', 'Asset'), $url;
unless ($asset->canView($userId)) { unless ($asset->canView($userId)) {
print WebGUI::International::get('bad user privileges', 'Asset')."<br />\n"; print WebGUI::International::get('bad user privileges', 'Asset')."\n";
next; next;
} }
my $path; my $path;
@ -253,15 +253,14 @@ sub www_exportGenerate {
$path = $session{config}{exportPath} . "/" . $path; $path = $session{config}{exportPath} . "/" . $path;
eval { mkpath($path) }; eval { mkpath($path) };
if($@) { if($@) {
print "Couldn't create $path because $@ <br />\n"; printf WebGUI::International::get('could not create path', 'Asset'), $path, $@;
print "This most likely means that you have a page with the same name as folder that you're trying to create.<br />\n";
return; return;
} }
} }
$path .= "/".$filename; $path .= "/".$filename;
eval { open(FILE, "> $path") or die "$!" }; eval { open(FILE, "> $path") or die "$!" };
if ($@) { if ($@) {
print "Couldn't open $path because $@ <br />\n"; printf WebGUI::International::get('could not open path', 'Asset'), $path, $@;
return; return;
} else { } else {
print FILE $self->exportAsHtml({userId=>$userId,extrasUrl=>$extrasURL,uploadsUrl=>$uploadsURL}); print FILE $self->exportAsHtml({userId=>$userId,extrasUrl=>$extrasURL,uploadsUrl=>$uploadsURL});
@ -269,7 +268,7 @@ sub www_exportGenerate {
} }
print WebGUI::International::get('done','Asset'); print WebGUI::International::get('done','Asset');
} }
print "<p>Exported ".scalar(@{$assets})." pages in ".(time()-$startTime)." seconds.</p>"; printf WebGUI::International::get('export information','Asset'), scalar(@{$assets}), (time()-$startTime);
print '<a target="_parent" href="'.$self->getUrl.'">'.WebGUI::International::get(493,"Asset").'</a>'; print '<a target="_parent" href="'.$self->getUrl.'">'.WebGUI::International::get(493,"Asset").'</a>';
return; return;
} }

View file

@ -792,15 +792,36 @@ config file must be enabled for this function to be available.</p>
}, },
'exporting page' => { 'exporting page' => {
message => q|Exporting page|, message => q|Exporting page %-s ......|,
lastUpdated => 1129420080, lastUpdated => 1129420080,
}, },
'bad user privileges' => { 'bad user privileges' => {
message => q|User has no privileges to view this page.|, message => q|User has no privileges to view this page.<br />|,
lastUpdated => 1129420080, lastUpdated => 1129420080,
}, },
'could not create path' => {
message => q|
Couldn't create %-s because %-s <br />
This most likely means that you have a page with the same name as folder that you're trying to create.<br />
|,
lastUpdated => 1129436410,
},
'could not open path' => {
message => q|
Couldn't open %-s because %-s <br />
|,
lastUpdated => 1129436544,
},
'export information' => {
message => q|
<p>Exported %d pages in %d seconds.</p>|,
lastUpdated => 1129436684,
},
'done' => { 'done' => {
message => q|DONE<br />|, message => q|DONE<br />|,
lastUpdated => 1129420080, lastUpdated => 1129420080,