From 6e5fac00670d3d61fa4cd797b23d431ee2981d38 Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Wed, 1 Jun 2011 07:20:02 +0000 Subject: patched for #326 --- framework/I18N/TGlobalization.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/I18N/TGlobalization.php b/framework/I18N/TGlobalization.php index 1280b6d5..135eea51 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. @@ -86,6 +90,22 @@ class TGlobalization extends TModule $this->getApplication()->setGlobalization($this); } + /** + * @return string default culture + */ + public function getTranslateDefaultCulture() + { + return $this->_translateDefaultCulture; + } + + /** + * @param bool default culture, e.g. en_US for American English + */ + public function setTranslateDefaultCulture($value) + { + $this->_translateDefaultCulture = TPropertyValue::ensureBoolean($value); + } + /** * @return string default culture */ @@ -155,7 +175,7 @@ class TGlobalization extends TModule */ public function getTranslationConfiguration() { - return ($this->getDefaultCulture() == $this->getCulture()) + return (!$this->_translateDefaultCulture && ($this->getDefaultCulture() == $this->getCulture())) ? null : $this->_translation; } -- cgit v1.2.3