From 4835704a04cf5aa5ec71a8aef902d54b9c6cae82 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 6 Jan 2006 04:42:44 +0000 Subject: Adding I18N support. --- framework/I18N/TGlobalizationAutoDetect.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 framework/I18N/TGlobalizationAutoDetect.php (limited to 'framework/I18N/TGlobalizationAutoDetect.php') diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php new file mode 100644 index 00000000..6cf17bcb --- /dev/null +++ b/framework/I18N/TGlobalizationAutoDetect.php @@ -0,0 +1,28 @@ + + * @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->Culture = $languages[0]; + } +} + +?> \ No newline at end of file -- cgit v1.2.3