[Seaside] getting results back
maarten.mostert at wanadoo.fr
Tue Aug 14 13:01:15 UTC 2007
Well this certainly gives me a result I can use
Lukas Renggli a écrit :
>> language isNil
>> [language := '??'.
>> script: 'if (navigator.appName == "Netscape")
>> var language = navigator.language;
>> var language = navigator.browserLanguage;
>> , html context actionUrl asString , '&'
>> , (html callbacks registerCallback: [:v | language
>> := v]) , '=" + language'].
>> html render: language.
> You already have it in an instance-variable called 'language'. Instead
> of rendering it on the screen you can do something else.
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
> Note that the language information is also present in the request
> compilant and easy:
> language := self session currentRequest headers
> at: 'accept-language'
> ifAbsent: [
> self session currentRequest headers
> at: 'lang' ifAbsent:  ]
Well this ceratinly gives me an easy to use result in my case:
However if I do this in my English Opera Browser it still gives french
Oké I haven't changed the OS language.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside