i18n'd some test for the status pages
This commit is contained in:
parent
c45452457d
commit
45c338ed31
3 changed files with 40 additions and 9 deletions
|
|
@ -37,11 +37,14 @@ use HTML::Entities;
|
|||
use JSON;
|
||||
|
||||
my $template = <<'TEMPLATE';
|
||||
<div id='loading'>Loading...</div>
|
||||
<div id='loading'>[% i18n('WebGUI', 'Loading...') %]</div>
|
||||
<div id='ui' style='display: none'>
|
||||
<p id='message'></p>
|
||||
<div id='meter'></div>
|
||||
<p>Time elapsed: <span id='elapsed'></span> seconds.</p>
|
||||
<p>
|
||||
[% i18n('Fork_ProgressBar', 'time elapsed') %]:
|
||||
<span id='elapsed'></span> [% i18n('Fork_ProgressBar', 'seconds') %].
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
(function (params) {
|
||||
|
|
@ -87,10 +90,10 @@ sub handler { renderBar( shift, $template ) }
|
|||
=head2 renderBar ( process, template )
|
||||
|
||||
Renders $template, passing a "params" variable to it that is JSON of a
|
||||
statusUrl to poll and a page to redirect to. Includes WebGUI.Fork.redirect,
|
||||
poll, and ProgressBar js and CSS (as well as all their YUI dependancies), and
|
||||
puts the whole template inside an adminConsole rendered based off some form
|
||||
parameters.
|
||||
statusUrl to poll and a page to redirect to and an i18n function. Includes
|
||||
WebGUI.Fork.redirect, poll, and ProgressBar js and CSS (as well as all their
|
||||
YUI dependancies), and puts the whole template inside an adminConsole rendered
|
||||
based off some form parameters.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -102,6 +105,10 @@ sub renderBar {
|
|||
my $style = $session->style;
|
||||
my $tt = Template->new;
|
||||
my %vars = (
|
||||
i18n => sub {
|
||||
my ($namespace, $key) = @_;
|
||||
return WebGUI::International->new($session, $namespace)->get($key);
|
||||
},
|
||||
params => JSON::encode_json( {
|
||||
statusUrl => $url->page( $process->contentPairs('Status') ),
|
||||
redirect => scalar $form->get('proceed'),
|
||||
|
|
|
|||
|
|
@ -38,12 +38,14 @@ use JSON;
|
|||
use WebGUI::Fork::ProgressBar;
|
||||
|
||||
my $template = <<'TEMPLATE';
|
||||
<div id='loading'>Loading...</div>
|
||||
<div id='loading'>[% i18n('WebGUI', 'Loading...') %]</div>
|
||||
<div id='ui' style='display: none'>
|
||||
<div id='meter'></div>
|
||||
Current asset: <span id='focus'></span>
|
||||
[% i18n('Fork_ProgressBar', 'current asset') %]: <span id='focus'></span>
|
||||
(<span id='finished'></span>/<span id='total'></span>).<br />
|
||||
<span id='elapsed'></span> seconds elapsed.
|
||||
[% i18n('Fork_ProgressBar', 'time elapsed') %]:
|
||||
<span id='elapsed'></span>
|
||||
[% i18n('Fork_ProgressBar', 'seconds') %].
|
||||
<ul id='tree'></ul>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
|||
22
lib/WebGUI/i18n/English/Fork_ProgressBar.pm
Normal file
22
lib/WebGUI/i18n/English/Fork_ProgressBar.pm
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package WebGUI::i18n::English::Fork_ProgressBar;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'time elapsed' => {
|
||||
message => 'Time Elapsed',
|
||||
lastUpdated => 1286466369,
|
||||
context => 'Used as a label to indicate how many seconds have gone by since the forked process started running',
|
||||
},
|
||||
'seconds' => {
|
||||
message => 'seconds',
|
||||
lastUpdated => 1286466433,
|
||||
},
|
||||
'current asset' => {
|
||||
message => 'Current Asset',
|
||||
lastUpdated => 1286466701,
|
||||
context => 'Used as a label to indicate which asset is in "focus"',
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue