[Seaside] Language Detection
Maarten MOSTERT
maarten.mostert at wanadoo.fr
Wed Jul 25 15:21:50 UTC 2007
Dear Michel,
So If I read well I should combine the following Chinese methods to obtain 'it', 'fr', 'de' ...etc.
x isNil ifTrue: [
x := 0. y := 0.
html script: 'window.location.href="' , html context actionUrl asString ,
'&' , (html callbacks registerCallback: [ :v | x := v asNumber]) ,
'=" + screen.width + "' ,
'&' , (html callbacks registerCallback: [ :v | y := v asNumber]) ,
'=" + screen.height' ].
html render: x; text: ' x '; render: y
<!-- PLACE IN HEADER -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
/*
Find free scripts and get free help:
www.able2know.com
*/
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = 'english.html';
else if (language.indexOf('de') > -1) document.location.href = 'german.html';
else if (language.indexOf('it') > -1) document.location.href = 'italian.html';
else
document.location.href = 'defaultpage.html';
// End -->
</script>
Thanks,..
Lucky ME !!!
@+Maarten,
> Message du 25/07/07 16:30
> De : "Bany, Michel"
> A : "Maarten MOSTERT" , "Seaside - general discussion"
> Copie à :
> Objet : RE: [Seaside] Language Detection
>
>
Hi Maarten.
You can pull any data you want from the browser using a java-script in a redirect
See http://lists.squeakfoundation.org/pipermail/seaside/2007-July/012857.html
HTH
Michel.
>
From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Maarten MOSTERT
> Sent: mercredi, 25. juillet 2007 16:23
> To: Seaside - general discussion
> Subject: [Seaside] Language Detection
>
>
> Hi,
> Is there a way in seaside to detect the browsers local language and adapt so accordingly ?
> Rgrds,
> @+Maarten,
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070725/229e99cb/attachment.htm
More information about the Seaside
mailing list