summaryrefslogtreecommitdiff
path: root/framework/I18N/TGlobalization.php
diff options
context:
space:
mode:
authorctrlaltca@gmail.com <>2011-06-01 07:20:38 +0000
committerctrlaltca@gmail.com <>2011-06-01 07:20:38 +0000
commitef1c3727e909fcc26b2ee6f7517d458f41ca8ef4 (patch)
tree73aa3ad122cb5ca65b7010794d432b16d67ff43d /framework/I18N/TGlobalization.php
parentf926b6484ac1086a1b72bd8de1375a6a3bb44636 (diff)
backported r2935 to branch/3.1
Diffstat (limited to 'framework/I18N/TGlobalization.php')
-rw-r--r--framework/I18N/TGlobalization.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php
index 6e00dd48..6c044db0 100644
--- a/framework/I18N/TGlobalization.php
+++ b/framework/I18N/TGlobalization.php
@@ -56,6 +56,10 @@ class TGlobalization extends TModule
*/
private $_translation;
+ /**
+ * @var boolean whether we should translate the default culture
+ */
+ private $_translateDefaultCulture=true;
/**
* Initialize the Culture and Charset for this application.
@@ -83,6 +87,22 @@ class TGlobalization extends TModule
/**
* @return string default culture
*/
+ public function getTranslateDefaultCulture()
+ {
+ return $this->_translateDefaultCulture;
+ }
+
+ /**
+ * @param bool default culture, e.g. <tt>en_US</tt> for American English
+ */
+ public function setTranslateDefaultCulture($value)
+ {
+ $this->_translateDefaultCulture = TPropertyValue::ensureBoolean($value);
+ }
+
+ /**
+ * @return string default culture
+ */
public function getDefaultCulture()
{
return $this->_defaultCulture;
@@ -149,7 +169,7 @@ class TGlobalization extends TModule
*/
public function getTranslationConfiguration()
{
- return ($this->getDefaultCulture() == $this->getCulture())
+ return (!$this->_translateDefaultCulture && ($this->getDefaultCulture() == $this->getCulture()))
? null
: $this->_translation;
}