[ic] english and spanish site

Damien Claire interchange-users@icdevgroup.org
Thu Aug 8 10:11:01 2002


-----Original Message-----
From: interchange-users-admin@icdevgroup.org
[mailto:interchange-users-admin@icdevgroup.org] On Behalf Of Stefan
Hornburg (Racke)
Sent: Thursday, August 08, 2002 2:37 AM
To: interchange-users@icdevgroup.org
Subject: Re: [ic] english and spanish site

"Damien Claire" <damien@usamkt.com> writes:

> I was wondering if it is possible with interx to do a site with
> capability to have a choice of two languages on the site?
> 
> What I want is to have a button on the top of the site where customers
> can choose if they want to shop in English or in Spanish, and be able
to
> switch between the two languages without loosing their shopping cart?

Yes, modify this as it suits you:

UserTag language_link Routine <<EOR
sub {
	my ($lang, $label, $page, $arg, $url);

	# determine which language should be offered
    if ($Scratch->{mv_locale} eq 'en_US') {
        $lang = 'de_DE';
        $label = '.de';
	} else {
    	$lang = 'en_US';
    	$label = '.com';
	}
	
	# special case for the flypage
	$page = $Tag->var('MV_PAGE', 1);
	$arg = '';
	if ($page eq $Config->{Special}->{flypage}) {
		$arg = $Scratch->{arg};
	}	

	# create link
	$url = $Tag->area({href=>"process/locale/$lang/page/$page",
				 	  secure=>$Session->{shost},
				   	  arg => $arg});
	qq{<a href="$url" class="navigation">|$label|</a>};
}
EOR

Ciao
        Racke

-----------------------

Thank you very much :)

damien