[ic] english and spanish site

Stefan Hornburg Racke interchange-users@icdevgroup.org
Thu Aug 8 02:38:05 2002


"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

-- 
Prolific Interchange Consulting (Excellent German Quality !).
Take a look at Materialboerse (http://www.materialboerse.de/), WITT 
(http://www.witt-weiden.de/), Boxmover (http://shop.boxmover.ch/) or 
Passionshop (http://www.passionshop.com/racke). Need a shop ? Contact us.