php_dev_101 Posted October 1, 2009 Share Posted October 1, 2009 Hi all, In the .NET world a web application can be displayed in a users language by detecting their "Regional and Language Settings" on their Windows OS and then using this to localize the content. Is this possible in a PHP/Javascript application? I couldn't find any way to do this online. Any thoughts? PHP Dev Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted October 1, 2009 Share Posted October 1, 2009 It's perfectly possible to read regional and language settings using javascript when the browser is running on a Windows client, and to pass that information to a PHP script. http://browserspy.dk/ shows just how much information can be retrieved using javascript Quote Link to comment Share on other sites More sharing options...
andyd34 Posted October 1, 2009 Share Posted October 1, 2009 try this $local = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $local = split("-", $local); $language = $local[0]; $location = $local[1]; echo "Browser language is $language and your location is $location "; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.