Permalink
Browse files

Merge pull request #3203 from infoza/master

Solving issue #3077
  • Loading branch information...
2 parents 4e8b4d1 + 5c7c1c7 commit eb8516b8e744f1f4cf73c5cb05df676e6b5107cf @samdark samdark committed Feb 5, 2014
Showing with 12 additions and 4 deletions.
  1. +1 −0 CHANGELOG
  2. +11 −4 framework/base/CApplication.php
View
1 CHANGELOG
@@ -69,6 +69,7 @@ Version 1.1.15 under development
- Enh #3147: Updated Request::getIsSecureConnection() to work with lower and uppercase config values (cebe)
- Enh #3182: Added namespace support for controllers in subdirectories (Ekstazi, samdark)
- Enh #3202: Adding support for the `X-HTTP-Method-Override` header in CHttpRequest (pawzar)
+- Enh #3307: Adding attribute localeClass to CApplication (pawzar)
- Chg #3137: Upgraded HTMLPurifier to 4.6.0 (samdark)
- New #2955: Added official support for MariaDB (cebe, DaSourcerer)
View
15 framework/base/CApplication.php
@@ -97,6 +97,10 @@
* the language that the messages and view files are in. Defaults to 'en_us' (US English).
*/
public $sourceLanguage='en_us';
+ /**
+ * @var string the class used to get locale data. Defaults to 'CLocale'.
+ */
+ public $localeClass='CLocale';
private $_id;
private $_basePath;
@@ -395,11 +399,12 @@ public function findLocalizedFile($srcFile,$srcLanguage=null,$language=null)
/**
* Returns the locale instance.
* @param string $localeID the locale ID (e.g. en_US). If null, the {@link getLanguage application language ID} will be used.
- * @return CLocale the locale instance
+ * @return an instance of CLocale
*/
public function getLocale($localeID=null)
{
- return CLocale::getInstance($localeID===null?$this->getLanguage():$localeID);
+ $class=$this->localeClass;
+ return $class::getInstance($localeID===null?$this->getLanguage():$localeID);
}
/**
@@ -409,7 +414,8 @@ public function getLocale($localeID=null)
*/
public function getLocaleDataPath()
{
- return CLocale::$dataPath===null ? Yii::getPathOfAlias('system.i18n.data') : CLocale::$dataPath;
+ $class=$this->localeClass;
+ return $class::$dataPath===null ? Yii::getPathOfAlias('system.i18n.data') : $class::$dataPath;
}
/**
@@ -419,7 +425,8 @@ public function getLocaleDataPath()
*/
public function setLocaleDataPath($value)
{
- CLocale::$dataPath=$value;
+ $class=$this->localeClass;
+ $class::$dataPath=$value;
}
/**

0 comments on commit eb8516b

Please sign in to comment.