Fix #18988: Fix default value of yii\console\controllers\MessageController::$translator

This commit is contained in:
Anton
2021-11-02 13:21:37 +03:00
committed by GitHub
parent 4c1f872320
commit 03235e6c12
3 changed files with 8 additions and 7 deletions

View File

@ -27,7 +27,7 @@ Yii Framework 2 Change Log
- Bug #18913: Add filename validation for `MessageSource::getMessageFilePath()` (uaoleg)
- Bug #18909: Fix bug with binding default action parameters for controllers (bizley)
- Bug #18955: Check `yiisoft/yii2-swiftmailer` before using as default mailer in `yii\base\Application` (WinterSilence)
- Enh #18962: Extend ignore list in `yii\console\MessageController::$except` (WinterSilence)
- Bug #18988: Fix default value of `yii\console\controllers\MessageController::$translator` (WinterSilence)
2.0.43 August 09, 2021

View File

@ -58,12 +58,11 @@ class MessageController extends \yii\console\Controller
*/
public $languages = [];
/**
* @var string|array the name of the function for translating messages.
* Defaults to 'Yii::t'. This is used as a mark to find the messages to be
* translated. You may use a string for single function name or an array for
* multiple function names.
* @var string|string[] the name of the function for translating messages.
* This is used as a mark to find the messages to be translated.
* You may use a string for single function name or an array for multiple function names.
*/
public $translator = 'Yii::t';
public $translator = ['Yii::t', '\Yii::t'];
/**
* @var bool whether to sort messages by keys when merging new messages
* with the existing ones. Defaults to false, which means the new (untranslated)