R: R: R: [ic] help with locale please

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


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

> Something like this is rigth?
> 
> UserTag language-field Order field code
> UserTag language-field Routine <<EOF
> sub {
> 	my ($comment_it_IT, $code) = @_;
> 	my $data;
> 	my $locale = $Scratch->{mv_locale};
> 
> 	if ($locale) {
> 		$data = $Tag->data('products',"${comment_it_IT}_$locale",$code);
> 		return $data if $data =~ /\S/;
> 	}
> 	$Tag->data('products',$comment_it_IT,$code);
> }
> EOF
> 
> If i've done errors, could you correct it please?
> It's not so simple, i'm not so expert.

No, I think this leads into the wrong direction. Lets start with the
database setup, then we talk about applying this function.

I assume you have something like that as products database:

sku    comment          comment_it_IT           whatever whatever_it_IT
11111  English Comment  Commentare Italiano     Bye      Ciao

Now, if you use my original function and 

[language-field comment [item-code]]

resp.

[language-field whatever [item-code]]

You get the text of comment_it_IT resp. whatever_it_IT if the selected
language is it_IT, otherwise the text from comment resp. whatever.

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)