public function translate($category, $message, $language = null) { $translation = parent::translate($category, $message, $language); if ($translation == $message) { $translation = parent::translate('Default', $message, $language); } return $translation; }
/** * Initializes the application component. * This method overrides the parent implementation by preprocessing * the user request data. */ public function init() { parent::init(); if (($this->_db = Yii::app()->getComponent($this->connectionID)) instanceof CDbConnection) { $this->_db->setActive(true); } else { throw new CException(Yii::t('yii', 'CDbMessageSource.connectionID is invalid. Please make sure "{id}" refers to a valid database application component.', array('{id}' => $this->connectionID))); } }