Permalink
Browse files

#3077

  • Loading branch information...
1 parent 5ff92de commit c8837495b4a9aa434d8dcc6ca8bd00fd0bfd0554 pzaremba committed Feb 5, 2014
Showing with 11 additions and 4 deletions.
  1. +11 −4 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 c883749

Please sign in to comment.