PHP Classes

Language Detector: Detect the preferred language of the user

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-11-25 (5 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 386 All time: 6,112 This week: 1,374Up
Version License PHP version Categories  
language-detector 2.1.0Free To Use But R...5.0Localization, HTTP, PHP 5
Description Author  

This class can detect the preferred language of the user accessing the site.

It can look at the HTTP request accept header and determine the preferred language of the user from a list of supported languages.

The detected language can fallback to a language associated to the user country in case the Accept header is not sent by the browser.

The detected language can be stored in a cookie to avoid needing to detect the language again in subsequent requests.

Picture of Peter Kahl
Name: Peter Kahl <contact>
Classes: 5 packages by
Country: Hong Kong Hong Kong
Age: ???
All time rank: 11765 in Hong Kong Hong Kong
Week rank: 683 Up3 in Hong Kong Hong Kong Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Plain text file class.language-detector.php Class Class
Plain text file example-1.php Example Simple application, instructions.
Plain text file example-2.php Example Shows practical application on web page.
Plain text file Doc. Readme

 Version Control Unique User Downloads Download Rankings  
 0%Total:386All time:6,112
 This week:0This week:1,374Up