/** * Set the Culture by using the HTTPNegotiator to find * the prefered language from the client browser. */ function init() { //initialize other information. parent::init(); $http = new HTTPNegotiator(); $languages = $http->getLanguages(); if (count($languages) > 0) { $this->Culture = $languages[0]; } }
public function init($xml) { parent::init($xml); //set the culture according to browser language settings $http = new HTTPNegotiator(); $languages = $http->getLanguages(); if (count($languages) > 0) { $this->_detectedLanguage = $languages[0]; $this->setCulture($languages[0]); } }