PHP User Agent Language Detection
finda
Status: New User - Welcome
Joined: 24 Jun 2007
Posts: 2
Reply Quote
I have checked this on the page:
techpatterns.com/downloads/php_language_detection.php

It works fine with IE:

System Language
Primary Language id: de
Primary Language:
German (Germany)

but with FF:

System Language
Primary Language id: da
Primary Language:
Danish

I have changed the system language from danish to german,
in the control panel > international, just to test this.

How do I get the right language (de) with FF?
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Firefox apparently did not update its own information when you upgraded windows, which is hardly surprising.

This script processes data that the browser sends to the web server - the thing, that is, that runs this language script - not the operating system (your operating system never talks directly to the internet, or shouldn't, Windows of course has a non stop stream of communication with the internet even if you try to stop it). So the question is not how you make the script do something, it's how you make firefox do something, and that question I can't answer.

I assume there is some configuration file somewhere in firefox's collection of files that has not been updated, and needs to be manually updated.
Back to top
finda
Status: New User - Welcome
Joined: 24 Jun 2007
Posts: 2
Reply Quote
Just to be sure that you know.
I haven't downloaded the script, the test is done here on your site.

With Opera it is the same: (control panel > international > german language):

Operating System:

Windows
NT 5.1 (Windows XP)
Current Browser / UA:

User Agent: Opera
Full Version Info: 9.21
XHTML support: Yes
System Language

Primary Language id: da-dk
Primary Language:
Current Screen Resolution

1024 x 768 pixels
JavaScript

JavaScript is enabled.
Cookies

Cookies are enable

***
Opera with french lang:

Operating System:

Windows
NT 5.1 (Windows XP)
Current Browser / UA:

User Agent: Opera
Full Version Info: 9.21
XHTML support: Yes
System Language

Primary Language id: da-dk
Primary Language:

***
IE6 with french lang:

Operating System:
Windows
NT 5.1 (Windows XP)

Current Browser / UA:
User Agent: MSIE
Full Version Info: 6.0
XHTML support: No

System Language
Primary Language id: fr
Primary Language:
French (France)
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
It makes no difference, what I said applies to the site version or any version, the script is reporting what Firefox, or any other browser you test it in, told it, nothing more.

So the problem is with how those browsers are not getting updated in Windows, not the script, the browsers failed to correctly update its system language, I assume anyway. Sometimes rebooting in Windows might reset some settings, I have no idea, I don't use windows.

The script can't do anything about that, it just works on the data that the browser sends it.

Obviously non MSIE browsers aren't getting their system language settings updated, there's nothing we can do about that, sorry.

You can post as many browsers as you'd like, it won't change the fact the script is simply acting on the information sent by the browser, so that's where the problem is.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours