Language Detection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Language Detection

Maarten Mostert-2

Hi,

Is there a way in seaside to detect the browsers local language and adapt so accordingly ?

Rgrds,

@+Maarten,

 

 

 

 

 


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Language Detection

Bany, Michel
Hi Maarten.
You can pull any data you want from the browser using a javascript in a redirect
HTH
Michel.


From: [hidden email] [mailto:[hidden email]] 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,

 

 

 

 

 


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Language Detection

Maarten Mostert-2
In reply to this post by Maarten Mostert-2

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
HTH
Michel.

>

From: [hidden email] [mailto:[hidden email]] 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,

>  

>  

>  

>  

>  

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Language Detection

Philippe Marschall
In reply to this post by Maarten Mostert-2
Accept-Language http header field. A fully confirming parser is not a
one-liner but something that would certainly be welcomed.

Philippe

2007/7/25, Maarten MOSTERT <[hidden email]>:

>
>
> Hi,
>
> Is there a way in seaside to detect the browsers local language and adapt so
> accordingly ?
>
> Rgrds,
>
> @+Maarten,
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside