mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 14:28:27 +08:00
Fixes #4292: The error messages for console commands will not be translated
This commit is contained in:
@ -51,9 +51,8 @@ class HelpController extends Controller
|
||||
if ($command !== null) {
|
||||
$result = Yii::$app->createController($command);
|
||||
if ($result === false) {
|
||||
throw new Exception(Yii::t('yii', 'No help for unknown command "{command}".', [
|
||||
'command' => $this->ansiFormat($command, Console::FG_YELLOW),
|
||||
]));
|
||||
$name = $this->ansiFormat($command, Console::FG_RED);
|
||||
throw new Exception("No help for unknown command \"$name\".");
|
||||
}
|
||||
|
||||
list($controller, $actionID) = $result;
|
||||
@ -251,9 +250,8 @@ class HelpController extends Controller
|
||||
{
|
||||
$action = $controller->createAction($actionID);
|
||||
if ($action === null) {
|
||||
throw new Exception(Yii::t('yii', 'No help for unknown sub-command "{command}".', [
|
||||
'command' => rtrim($controller->getUniqueId() . '/' . $actionID, '/'),
|
||||
]));
|
||||
$name = $this->ansiFormat(rtrim($controller->getUniqueId() . '/' . $actionID, '/'), Console::FG_RED);
|
||||
throw new Exception("No help for unknown sub-command \"$name\".");
|
||||
}
|
||||
|
||||
$description = $controller->getActionHelp($action);
|
||||
|
Reference in New Issue
Block a user