first wave of i18n fixes
This commit is contained in:
parent
b22cc241c0
commit
16b0edfb6b
4 changed files with 14 additions and 9 deletions
|
|
@ -93,15 +93,16 @@ Renders a select list form control.
|
|||
sub toHtml {
|
||||
my $self = shift;
|
||||
my %types;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
foreach my $type (@{$self->get("types}")) {
|
||||
if ($type eq "text") {
|
||||
$types{text} = WebGUI::International::get(1010);
|
||||
$types{text} = $i18n->get(1010);
|
||||
} elsif ($type eq "mixed") {
|
||||
$types{mixed} = WebGUI::International::get(1008);
|
||||
$types{mixed} = $i18n->get(1008);
|
||||
} elsif ($type eq "code") {
|
||||
$types{code} = WebGUI::International::get(1011);
|
||||
$types{code} = $i18n->get(1011);
|
||||
} elsif ($type eq "html") {
|
||||
$types{html} = WebGUI::International::get(1009);
|
||||
$types{html} = $i18n->get(1009);
|
||||
}
|
||||
}
|
||||
$self->get("options") = \%types,
|
||||
|
|
|
|||
|
|
@ -100,10 +100,11 @@ sub displayForm {
|
|||
my $location = WebGUI::Storage->get($self->session,$self->get("value"));
|
||||
my $id = $location->getId;
|
||||
my $fileForm = '';
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
foreach my $file ( @{ $location->getFiles } ) {
|
||||
$fileForm .= sprintf qq!<img src="%s" /><br />!, $location->getUrl($file);
|
||||
my $action = join '_', '_', $self->get("name"), 'delete';
|
||||
$fileForm .= WebGUI::International::get(392)
|
||||
$fileForm .= $i18n->get(392)
|
||||
. " "x4
|
||||
. WebGUI::Form::YesNo->new({-name=>$action, -value=>0})->toHtml;
|
||||
}
|
||||
|
|
@ -193,7 +194,8 @@ sub toHtml {
|
|||
$uploadControl .= 'fileIcons["'.$ext.'"] = "'.$self->session->config->get("extrasURL").'/fileIcons/'.$file.'";'."\n";
|
||||
}
|
||||
}
|
||||
$uploadControl .= 'var uploader = new FileUploadControl("'.$self->get("name").'", fileIcons, "'.WebGUI::International::get('removeLabel','WebGUI').'","'.$self->get("maxAttachments").'");
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$uploadControl .= 'var uploader = new FileUploadControl("'.$self->get("name").'", fileIcons, "'.$i18n->get('removeLabel','WebGUI').'","'.$self->get("maxAttachments").'");
|
||||
uploader.addRow();
|
||||
</script>';
|
||||
return $uploadControl;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ Renders a button.
|
|||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value = $self->fixQuotes($self->get("value"));
|
||||
$self->get("extras") ||= 'onclick="this.value=\''.WebGUI::International::get(452).'\'"';
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->get("extras") ||= 'onclick="this.value=\''.$i18n->get(452).'\'"';
|
||||
my $html = '<input type="submit" ';
|
||||
$html .= 'name="'.$self->get("name").'" ' if ($self->get("name"));
|
||||
$html .= 'id="'.$self->{id}.'" ' unless ($self->{id} eq "_formId");
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ Renders a yes/no question field.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
my ($checkYes, $checkNo);
|
||||
if ($self->get("value")) {
|
||||
$checkYes = 1;
|
||||
|
|
@ -114,7 +115,7 @@ sub toHtml {
|
|||
value=>1,
|
||||
extras=>$self->get("extras")
|
||||
)->toHtml;
|
||||
$output .= WebGUI::International::get(138);
|
||||
$output .= $i18n->get(138);
|
||||
$output .= ' ';
|
||||
$output .= WebGUI::Form::Radio->new(
|
||||
checked=>$checkNo,
|
||||
|
|
@ -122,7 +123,7 @@ sub toHtml {
|
|||
value=>0,
|
||||
extras=>$self->get("extras")
|
||||
)->toHtml;
|
||||
$output .= WebGUI::International::get(139);
|
||||
$output .= $i18n->get(139);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue