/t5/dreamweaver-discussions/detect-language-used-by-browser/td-p/969207Mar 28, 2008
Mar 28, 2008
Copy link to clipboard
Copied
Hi,
Back after a long time, I have a new problem:
the html page I made last year, whith an integrated Flash
module works well.
But now, I would like to detect automatically in the Html
code the browser language page code in order to open or the default
flash module (french) or if the browser is not in french, by
default my english flash animation.
I don't no how to make this in html. Can you please help me ?
thanks in advance for your precious help.
/t5/dreamweaver-discussions/detect-language-used-by-browser/m-p/969208#M137882Mar 29, 2008
Mar 29, 2008
Copy link to clipboard
Copied
.oO(alien_6390)
> Back after a long time, I have a new problem:
> the html page I made last year, whith an integrated
Flash module works well.
> But now, I would like to detect automatically in the
Html code the browser
>language page code in order to open or the default flash
module (french) or if
>the browser is not in french, by default my english flash
animation.
> I don't no how to make this in html. Can you please help
me ?
> thanks in advance for your precious help.
You can't do that in HTML. You need some server-side
scripting to check
and parse the HTTP Accept-Language header, which is sent by
the browser.
On an Apache server a feature called "content negotiation"
might be
another option to let the server decide automatically which
language
variant of a page to return.
Ok, thanks for your answer, but I don't need to install and
configure a server I think. It seems to me that it is possible with
a Java script. Did you know something about that?
Thanks again.
>Ok, thanks for your answer, but I don't need to install
and configure a
>server I think.
I think you think wrong.
>It seems to me that it is possible with a Java script.
Did you know
>something about that?
No, and I wouldn't do it this way because it's completely
unreliable.
JavaScript is always just optional, reliable solutions are
done on the
server. I don't even know if and how this could be done with
JS at all.
Michael Fesser wrote:
> .oO(alien_6390)
>
>> Ok, thanks for your answer, but I don't need to
install and configure a
>> server I think.
>
> I think you think wrong.
>
>> It seems to me that it is possible with a Java
script. Did you know
>> something about that?
>
> No, and I wouldn't do it this way because it's
completely unreliable.
> JavaScript is always just optional, reliable solutions
are done on the
> server. I don't even know if and how this could be done
with JS at all.
>
> Micha
navigator.language // "en","de" etc
navigator.userLanguage (IE)
Mick