From 333eedb6eea18fdfb7bc0890cce1c30e6d44d363 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Fri, 6 Jan 2006 22:21:07 +0000
Subject:
---
framework/I18N/TGlobalization.php | 45 +++++++++++----------------------------
1 file changed, 13 insertions(+), 32 deletions(-)
(limited to 'framework/I18N/TGlobalization.php')
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 4e6d030c..0900943e 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -12,7 +12,7 @@
/**
- * TGlobalization contains settings for Culture, Charset, ContentType
+ * TGlobalization contains settings for Culture, Charset
* and TranslationConfiguration.
*
* TGlobalization can be subclassed to change how the Culture, Charset
@@ -38,12 +38,6 @@ class TGlobalization extends TModule
*/
private $_defaultCulture = 'en';
- /**
- * Default content type is 'text/html'
- * @var ${type}
- */
- private $_defaultContentType = 'text/html';
-
/**
* Translation source parameters.
* @var TMap
@@ -62,12 +56,6 @@ class TGlobalization extends TModule
*/
protected $_culture='en';
- /**
- * The content type for the http header
- * @var string
- */
- protected $_contentType='text/html';
-
/**
* Initialize the Culture and Charset for this application.
* You should override this method if you want a different way of
@@ -77,7 +65,6 @@ class TGlobalization extends TModule
*/
public function init($xml)
{
- $this->_defaultContentType = $this->getContentType();
$this->_defaultCharset = $this->getCharset();
$this->_defaultCulture = $this->getCulture();
@@ -86,36 +73,38 @@ class TGlobalization extends TModule
$this->getApplication()->setGlobalization($this);
}
+ /**
+ * @return string current application culture
+ */
public function getCulture()
{
return $this->_culture;
}
+ /**
+ * @param string culture, e.g. en_US for American English
+ */
public function setCulture($culture)
{
$this->_culture = str_replace('-','_',$culture);
}
+ /**
+ * @return string localization charset
+ */
public function getCharset()
{
return $this->_charset;
}
+ /**
+ * @param string localization charset, e.g. UTF-8
+ */
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.
*/
@@ -166,14 +155,6 @@ class TGlobalization extends TModule
return $this->_defaultCulture;
}
- /**
- * @return string default content-type set in application.xml
- */
- public function getDefaultContentType()
- {
- return $this->_defaultContentType;
- }
-
/**
* Gets all the variants of a specific culture. If the parameter
* $culture is null, the current culture is used.
--
cgit v1.2.3