i18n the clipboard pasting progress bar data.
This commit is contained in:
parent
a85924d07b
commit
db49a54e28
2 changed files with 26 additions and 6 deletions
|
|
@ -186,14 +186,16 @@ A reference to a subroutine that output messages should be sent to.
|
||||||
sub paste {
|
sub paste {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $assetId = shift;
|
my $assetId = shift;
|
||||||
my $outputSub = shift;
|
my $outputSub = shift;
|
||||||
my $pastedAsset = WebGUI::Asset->newByDynamicClass($self->session,$assetId);
|
my $session = $self->session;
|
||||||
|
my $pastedAsset = WebGUI::Asset->newByDynamicClass($session,$assetId);
|
||||||
return 0 unless ($self->get("state") eq "published");
|
return 0 unless ($self->get("state") eq "published");
|
||||||
return 0 unless ($pastedAsset->canPaste()); ##Allow pasted assets to have a say about pasting.
|
return 0 unless ($pastedAsset->canPaste()); ##Allow pasted assets to have a say about pasting.
|
||||||
|
|
||||||
# Don't allow a shortcut to create an endless loop
|
# 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);
|
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)) {
|
if ($self->getId eq $pastedAsset->get("parentId") || $pastedAsset->setParent($self)) {
|
||||||
$pastedAsset->publish(['clipboard','clipboard-limbo']); # Paste only clipboard items
|
$pastedAsset->publish(['clipboard','clipboard-limbo']); # Paste only clipboard items
|
||||||
$pastedAsset->updateHistory("pasted to parent ".$self->getId);
|
$pastedAsset->updateHistory("pasted to parent ".$self->getId);
|
||||||
|
|
@ -202,7 +204,7 @@ sub paste {
|
||||||
my $updateAssets = $pastedAsset->getLineage(['self', 'descendants'], {returnObjects => 1});
|
my $updateAssets = $pastedAsset->getLineage(['self', 'descendants'], {returnObjects => 1});
|
||||||
|
|
||||||
foreach (@{$updateAssets}) {
|
foreach (@{$updateAssets}) {
|
||||||
$outputSub->("indexing ".$_->getTitle) if defined $outputSub;
|
$outputSub->(sprintf $i18n->get('indexing %s'), .$pastedAsset->getTitle) if defined $outputSub;
|
||||||
$_->indexContent();
|
$_->indexContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -277,12 +277,30 @@ our $I18N = {
|
||||||
lastUpdated => 1245342798,
|
lastUpdated => 1245342798,
|
||||||
},
|
},
|
||||||
|
|
||||||
'Pasting %s' => {
|
'pasting %s' => {
|
||||||
message => q|Pasting %s|,
|
message => q|pasting %s|,
|
||||||
lastUpdated => 1245343280,
|
lastUpdated => 1245343280,
|
||||||
context => q|short for "I am pasting this asset onto the page."|
|
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' => {
|
'this asset only' => {
|
||||||
message => q|This Asset Only|,
|
message => q|This Asset Only|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue