R: [ic] help with locale please

Stefan Hornburg Racke interchange-users@lists.akopia.com
Mon May 14 08:37:01 2001


"Stefano Nota" <stefano@register.it> writes:

> Thanks but i can't uderstand what [loc][item-field comment][/loc] do
> I should manage to make appear a comment of the article in italian if the
> langauge is italian and in another language if it is in english

?? I don't understand your setup. Please explain more thoroughly.
Maybe you need sth like that.

UserTag language-field Order field code
UserTag language-field Routine <<EOF
sub {
	my ($field, $code) = @_;
	my $data;
	my $locale = $Scratch->{mv_locale};

	if ($locale) {
		$data = $Tag->data('products',"${field}_$locale",$code);
		return $data if $data =~ /\S/;
	}
	$Tag->data('products',$field,$code);
}	
EOF

You call this with [language-field comment [item-code]].

Explanation: The language is set to it_IT, so if there is a field
comment_it_IT with a text for this product, it display this,
otherwise the contents of the field comment.

Bye
        Racke

-- 
Master of Swiss Web 2001: http://www.zweifel.ch/

For projects and other business stuff please refer to COBOLT NetServices
(URL: http://www.cobolt.net; Email: info@cobolt.net; Phone: 0041-1-3884400)