[ic] UserTag and locale Problem

Ton Verhagen tverhagen at alamerce.nl
Fri Jan 18 08:27:42 EST 2008


Quoting Lars Tode:
>Hi list,
>
>may be some has an idea or a hint for the following problem.
>I still did not get it yet.
>
>A UserTag, lets call it check_basket, should controll some things like
>the minimum order value, the maximum order value and other stuff.
>
>If, for example, the total is less then the minimum order value,
>check_basket should set the error message "some text" using error:
>$Tag->error(
>    {
>     name  => 'my_error',
>     set   => $error_msg
>    }
>);
>
>$error_msg is set in this way
>
>my $error_msg    =  $Tag->filter(
>    {
>     'op'  => 'loc html2text vars_and_comments',
>     interpolate => 1,
>     body  => 'some text'
>    },
>    ''
>);
>
>The locale.txt:
>--snip--
>code    en_US
>some text   Some text [user_tag] again text
>--snap--

How about:

locale.txt:
code            en_US
some text       Some text %s again text


# Localize message string
my $param1 = "HERE";
my $msg = errmsg("some text", $param1);

# Set the error
$Tag->error( { name => 'my label', set => $msg });

Should result in:
Some text HERE again text



Best regards,

Ton

--
Alamerce Nederland --- Cornerstone of eBusiness
Phone +31-40-2374381    info at alamerce.nl    http://www.alamerce.nl

eCommerce Solutions -- Consulting -- Website & Interchange Hosting 




More information about the interchange-users mailing list