Commit 182fc688 by Alexander Makarov

Fixed overriding default message sources

parent af030c5f
...@@ -54,14 +54,14 @@ class I18N extends Component ...@@ -54,14 +54,14 @@ class I18N extends Component
public function init() public function init()
{ {
parent::init(); parent::init();
if (!isset($this->translations['yii'])) { if (!isset($this->translations['yii']) && !isset($this->translations['yii*'])) {
$this->translations['yii'] = [ $this->translations['yii'] = [
'class' => 'yii\i18n\PhpMessageSource', 'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en', 'sourceLanguage' => 'en',
'basePath' => '@yii/messages', 'basePath' => '@yii/messages',
]; ];
} }
if (!isset($this->translations['app'])) { if (!isset($this->translations['app']) && !isset($this->translations['app*'])) {
$this->translations['app'] = [ $this->translations['app'] = [
'class' => 'yii\i18n\PhpMessageSource', 'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => Yii::$app->sourceLanguage, 'sourceLanguage' => Yii::$app->sourceLanguage,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment