[interchange-i18n] Help on Multiple Language Store's
Stefan Hornburg
racke at linuxia.de
Thu Nov 28 04:26:00 UTC 2002
On Thu, 28 Nov 2002 12:58:27 +0530
Vijeeth <gvijeeth at etisbew.com> wrote:
> Hi List,
>
> I want Interchange store to develop in both langauges (English and
> Spain). I want a button which toggles between English to Spanish
> vice-versa and using different data base fields to each language. My
> idea is to create a ID field for shifting to display Spanish text or
> English text (DB too) for this I need to go all pages to place the
> conditions to display desired text.
You can construct the button with an usertag in the spirit of the following:
UserTag language_link Routine <<EOR
sub {
my ($lang, $currency, $label, $page, $arg, $url);
my @langs = ([qw(de_DE de_DE de)], [qw(en_US en_US us)], [qw(en_US en_UK uk)], [qw(pl_PL pl_PL pl)]);
my (@urls);
# special case for the flypage
$page = $Tag->var('MV_PAGE', 1);
$arg = '';
if ($page eq $Config->{Special}->{flypage}) {
$arg = $Scratch->{arg};
}
# create links
for (@langs) {
($lang, $currency, $label) = @$_;
$url = $Tag->area({href=>"process/locale/$lang/currency/$currency/page/$page",
secure=>$Scratch->{secure},
arg => $arg});
push (@urls, qq{<a href="$url" class="navigation" border=0><img src="/matstock/images/flagge_$label.gif" border=1 height=17 width=25></a>});
}
my $out = join(" \n", @urls);
return <<EOH;
<table width="141" border=0 cellspacing=0 cellpadding=0>
<tr><td align=center> <br>
$out
</td></tr>
</table>
EOH
}
EOR
For selecting database fields based on the language you may want to
consider to switch to 4.9 and use the Shadow database.
Ciao
Racke
More information about the interchange-i18n
mailing list