From db49a54e28a6afc37626845d0f9ecc01c247d753 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 18 Jun 2009 23:40:41 +0000 Subject: [PATCH] i18n the clipboard pasting progress bar data. --- lib/WebGUI/AssetClipboard.pm | 10 ++++++---- lib/WebGUI/i18n/English/Asset.pm | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index 269d525c6..a283c8109 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -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(); } diff --git a/lib/WebGUI/i18n/English/Asset.pm b/lib/WebGUI/i18n/English/Asset.pm index 9792837f9..289ae95b7 100644 --- a/lib/WebGUI/i18n/English/Asset.pm +++ b/lib/WebGUI/i18n/English/Asset.pm @@ -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,