i18n the controls for the JsonTable form plugin. Fixes bug #12116
This commit is contained in:
parent
d4672a92f1
commit
ef08d0d481
4 changed files with 49 additions and 6 deletions
|
|
@ -137,6 +137,10 @@ Send JS required for this plugin.
|
|||
sub headTags {
|
||||
my $self = shift;
|
||||
my ( $url, $style ) = $self->session->quick(qw( url style ));
|
||||
$style->setScript(
|
||||
$url->extras('yui/build/connect/connect-min.js'),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
$style->setScript(
|
||||
$url->extras('yui/build/yahoo-dom-event/yahoo-dom-event.js'),
|
||||
{ type => 'text/javascript' },
|
||||
|
|
@ -145,6 +149,10 @@ sub headTags {
|
|||
$url->extras('yui/build/json/json-min.js'),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
$style->setScript(
|
||||
$url->extras('yui-webgui/build/i18n/i18n.js'),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
$style->setScript(
|
||||
$url->extras('yui-webgui/build/form/jsontable.js'),
|
||||
{ type => 'text/javascript' },
|
||||
|
|
@ -162,6 +170,7 @@ Renders an input tag of type text.
|
|||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = WebGUI::International->new($session, 'WebGUI');
|
||||
my ( $url, $style ) = $session->quick(qw( url style ));
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->getOriginalValue)));
|
||||
my $output = '';
|
||||
|
|
@ -176,7 +185,7 @@ sub toHtml {
|
|||
# Buttons to add rows in the table footer
|
||||
my $cols = scalar @{ $self->get('fields') } + 1; # Extra column for buttons
|
||||
$output .= '</thead><tfoot><tr><td colspan="' . $cols . '">'
|
||||
. '<button id="' . $self->get('id') . '_add">' . "Add" . '</button>'
|
||||
. '<button id="' . $self->get('id') . '_add">' . $i18n->get('Add') . '</button>'
|
||||
. '</td></tr></tfoot>'
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -4725,6 +4725,24 @@ Users may override this setting in their profile.
|
|||
context => 'Description for pick style template page',
|
||||
},
|
||||
|
||||
'Up' => {
|
||||
message => 'Up',
|
||||
lastUpdate => 0,
|
||||
context => 'Up, as in move up.',
|
||||
},
|
||||
|
||||
'Down' => {
|
||||
message => 'Down',
|
||||
lastUpdate => 0,
|
||||
context => 'Down, as in move down.',
|
||||
},
|
||||
|
||||
'Add' => {
|
||||
message => 'Add',
|
||||
lastUpdate => 0,
|
||||
context => 'Add, as in to append or add more',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue