summaryrefslogtreecommitdiff
path: root/framework/I18N/TGlobalization.php
diff options
context:
space:
mode:
authorwei <>2006-01-06 05:16:25 +0000
committerwei <>2006-01-06 05:16:25 +0000
commited3e43d30524a76969fb7d42cb5e613c2e1a1d9a (patch)
tree7f0cd531766635363527715fd4614eb56df0a80c /framework/I18N/TGlobalization.php
parent4835704a04cf5aa5ec71a8aef902d54b9c6cae82 (diff)
Changing property scopes in TGlobalization
Diffstat (limited to 'framework/I18N/TGlobalization.php')
-rw-r--r--framework/I18N/TGlobalization.php47
1 files changed, 38 insertions, 9 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 473fe315..4e6d030c 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -54,19 +54,19 @@ class TGlobalization extends TModule
* The current charset.
* @var string
*/
- public $Charset='UTF-8';
+ protected $_charset='UTF-8';
/**
* The current culture.
* @var string
*/
- public $Culture='en';
+ protected $_culture='en';
/**
* The content type for the http header
* @var string
*/
- public $ContentType='text/html';
+ protected $_contentType='text/html';
/**
* Initialize the Culture and Charset for this application.
@@ -76,17 +76,46 @@ class TGlobalization extends TModule
* @param TXmlElement application configuration
*/
public function init($xml)
- {
- $this->Culture = str_replace('-','_',$this->Culture);
- $this->_defaultContentType = $this->ContentType;
- $this->_defaultCharset = $this->Charset;
- $this->_defaultCulture = $this->Culture;
+ {
+ $this->_defaultContentType = $this->getContentType();
+ $this->_defaultCharset = $this->getCharset();
+ $this->_defaultCulture = $this->getCulture();
$config = $xml->getElementByTagName('translation')->getAttributes();
$this->setTranslationConfiguration($config);
$this->getApplication()->setGlobalization($this);
}
+ public function getCulture()
+ {
+ return $this->_culture;
+ }
+
+ public function setCulture($culture)
+ {
+ $this->_culture = str_replace('-','_',$culture);
+ }
+
+ public function getCharset()
+ {
+ return $this->_charset;
+ }
+
+ public function setCharset($charset)
+ {
+ $this->_charset = $charset;
+ }
+
+ public function setContentType($type)
+ {
+ $this->_contentType = $type;
+ }
+
+ public function getContentType()
+ {
+ return $this->_contentType;
+ }
+
/**
* @return TMap translation source configuration.
*/
@@ -153,7 +182,7 @@ class TGlobalization extends TModule
*/
public function getCultureVariants($culture=null)
{
- if(is_null($culture)) $culture = $this->Culture;
+ if(is_null($culture)) $culture = $this->getCulture();
$variants = explode('_', $culture);
$result = array();
for(; count($variants) > 0; array_pop($variants))