blob: 3d550a626edb855d1f973c9daab8bbe71eeddecb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
Prado::using('System.I18N.core.HTTPNegotiator');
/**
* ${classname}
*
* ${description}
*
* @author Wei Zhuo<weizhuo[at]gmail[dot]com>
* @version $Revision: 1.66 $ $Date: ${DATE} ${TIME} $
* @package ${package}
*/
class TGlobalizationAutoDetect extends TGlobalization
{
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->setCulture($languages[0]);
}
}
?>
|