summaryrefslogtreecommitdiff
path: root/framework/I18N/TGlobalizationAutoDetect.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/I18N/TGlobalizationAutoDetect.php')
-rw-r--r--framework/I18N/TGlobalizationAutoDetect.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php
index 7393d79a..442135ff 100644
--- a/framework/I18N/TGlobalizationAutoDetect.php
+++ b/framework/I18N/TGlobalizationAutoDetect.php
@@ -25,6 +25,8 @@ Prado::using('System.I18N.core.HTTPNegotiator');
*/
class TGlobalizationAutoDetect extends TGlobalization
{
+ private $_detectedLanguage;
+
public function init($xml)
{
parent::init($xml);
@@ -33,7 +35,15 @@ class TGlobalizationAutoDetect extends TGlobalization
$http = new HTTPNegotiator();
$languages = $http->getLanguages();
if(count($languages) > 0)
+ {
+ $this->_detectedLanguage=$languages[0];
$this->setCulture($languages[0]);
+ }
+ }
+
+ public function getDetectedLanguage()
+ {
+ return $this->_detectedLanguage;
}
}