<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Well this certainly gives me a result I can use <br>
<br>
Lukas Renggli a écrit :
<blockquote
cite="mid:67628d690708140359i233e5cauc5a273a9d3055ad4@mail.gmail.com"
type="cite">
<blockquote type="cite">
<pre wrap=""> language isNil
ifTrue:
[language := '??'.
html
script: 'if (navigator.appName == "Netscape")
var language = navigator.language;
else
var language = navigator.browserLanguage;
window.location.href="'
, html context actionUrl asString , '&'
, (html callbacks registerCallback: [:v | language
:= v]) , '=" + language'].
html render: language.
</pre>
</blockquote>
<pre wrap=""><!---->
You already have it in an instance-variable called 'language'. Instead
of rendering it on the screen you can do something else.
</pre>
</blockquote>
I inspected the returned object in many ways but no way to get acces to
something indicating the language their must be a stupid thing I am
missing here.<br>
<blockquote
cite="mid:67628d690708140359i233e5cauc5a273a9d3055ad4@mail.gmail.com"
type="cite">
<pre wrap="">
Note that the language information is also present in the request
header. So instead of using JavaScript I would do something more
compilant and easy:
language := self session currentRequest headers
        at: 'accept-language'
        ifAbsent: [
                self session currentRequest headers
                        at: 'lang' ifAbsent: [] ]
Lukas
</pre>
</blockquote>
Well this ceratinly gives me an easy to use result in my case:
'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3'<br>
<br>
However if I do this in my English Opera Browser it still gives french
allthough the javascript gives English ?<br>
<br>
Oké I haven't changed the OS language.<br>
<br>
Rgrds,<br>
@+Maarten,<br>
<br>
<br>
<br>
<br>
</body>
</html>