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 Link to comment https://forums.phpfreaks.com/topic/176231-is-it-possible-to-detect-windows-regional-and-language-settings-in-a-php-app/ 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 Link to comment https://forums.phpfreaks.com/topic/176231-is-it-possible-to-detect-windows-regional-and-language-settings-in-a-php-app/#findComment-928745 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 "; Link to comment https://forums.phpfreaks.com/topic/176231-is-it-possible-to-detect-windows-regional-and-language-settings-in-a-php-app/#findComment-928755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.