Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Detect language used by browser

Guest
Mar 28, 2008 Mar 28, 2008

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.
TOPICS
Server side applications
462
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 29, 2008 Mar 29, 2008
.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.

Micha
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 29, 2008 Mar 29, 2008
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2008 Mar 31, 2008
.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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 31, 2008 Mar 31, 2008
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines