i18n the clipboard pasting progress bar data.

This commit is contained in:
Colin Kuskie 2009-06-18 23:40:41 +00:00
parent a85924d07b
commit db49a54e28
2 changed files with 26 additions and 6 deletions

View file

@ -186,14 +186,16 @@ A reference to a subroutine that output messages should be sent to.
sub paste {
my $self = shift;
my $assetId = shift;
my $outputSub = shift;
my $pastedAsset = WebGUI::Asset->newByDynamicClass($self->session,$assetId);
my $outputSub = shift;
my $session = $self->session;
my $pastedAsset = WebGUI::Asset->newByDynamicClass($session,$assetId);
return 0 unless ($self->get("state") eq "published");
return 0 unless ($pastedAsset->canPaste()); ##Allow pasted assets to have a say about pasting.
# Don't allow a shortcut to create an endless loop
return 0 if ($pastedAsset->get("className") eq "WebGUI::Asset::Shortcut" && $pastedAsset->get("shortcutToAssetId") eq $self->getId);
$outputSub->("pasting ".$pastedAsset->getTitle) if defined $outputSub;
my $i18n=WebGUI::International->new($session, 'Asset');
$outputSub->(sprintf $i18n->get('pasting %s'), .$pastedAsset->getTitle) if defined $outputSub;
if ($self->getId eq $pastedAsset->get("parentId") || $pastedAsset->setParent($self)) {
$pastedAsset->publish(['clipboard','clipboard-limbo']); # Paste only clipboard items
$pastedAsset->updateHistory("pasted to parent ".$self->getId);
@ -202,7 +204,7 @@ sub paste {
my $updateAssets = $pastedAsset->getLineage(['self', 'descendants'], {returnObjects => 1});
foreach (@{$updateAssets}) {
$outputSub->("indexing ".$_->getTitle) if defined $outputSub;
$outputSub->(sprintf $i18n->get('indexing %s'), .$pastedAsset->getTitle) if defined $outputSub;
$_->indexContent();
}

View file

@ -277,12 +277,30 @@ our $I18N = {
lastUpdated => 1245342798,
},
'Pasting %s' => {
message => q|Pasting %s|,
'pasting %s' => {
message => q|pasting %s|,
lastUpdated => 1245343280,
context => q|short for "I am pasting this asset onto the page."|
},
'indexing %s' => {
message => q|indexing %s|,
lastUpdated => 1245343280,
context => q|short for "I am adding this asset to the search index"|
},
'skipping %s' => {
message => q|skipping %s|,
lastUpdated => 1245343280,
context => q|To skip, to move over, to not process|
},
'Editing %s' => {
message => q|Editing %s|,
lastUpdated => 1245343280,
context => q|To edit or change|
},
'this asset only' => {
message => q|This Asset Only|,
lastUpdated => 0,