Fix more i18n issues with the RenderThingData macro. Addresses bug #12141

This commit is contained in:
Colin Kuskie 2011-05-25 08:49:12 -07:00
parent 926cfd18e4
commit 90b37da740
3 changed files with 11 additions and 4 deletions

View file

@ -1,4 +1,5 @@
7.10.18
- fixed #12141: Macro_RenderThingData (bad tags) nothing to translate
7.10.17
- fixed: Forced to use a PayDriver even with a balance of 0 in the cart.

View file

@ -51,13 +51,13 @@ sub process {
my $thing = WebGUI::Asset::Wobject::Thingy->newByUrl( $session, $uri->path );
# TODO: i18n
return ( "Bad URL: " . $thingDataUrl ) if !$thing || !$thingId || !$thingDataId;
return ( $i18n->get('bad url') . $thingDataUrl ) if !$thing || !$thingId || !$thingDataId;
# Render
my $output = $thing->www_viewThingData( $thingId, $thingDataId, $templateHint );
# FIX: Temporary solution (broken map due to template rendering <script> tags)
return "RenderThingData: Contained bad tags!" if $output =~ /script>/;
return $i18n->get('bad tags') if $output =~ /script>/;
return $output;
}

View file

@ -4,13 +4,19 @@ use strict;
our $I18N = {
'bad tags' => {
message => q||,
message => q|RenderThingData: Thingy output contains script tags.|,
lastUpdated => 1306275259,
},
'no template' => {
message => q|RenderThingData: Please specify a template.|,
lastUpdated => 1149177662,
lastUpdated => 1306337467,
},
'bad url' => {
message => q|Bad URL: |,
lastUpdated => 1306337468,
context => q|A URL with missing parameters or one that does not refer to a Thingy asset.|,
},
};