Skip to content

Commit

Permalink
Override getHelp in order to get the translated help text (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
LOBsTerr authored and jmolivas committed Jan 4, 2018
1 parent d3cef30 commit ca422c9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Command/Shared/CommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,22 @@ public function getDescription()

return parent::getDescription();
}

/**
* @inheritdoc
*/
public function getHelp()
{
$help = sprintf(
'commands.%s.help',
str_replace(':', '.', $this->getName())
);

if (parent::getHelp()==$help) {
return $this->trans($help);
}

return parent::getHelp();
}

}

0 comments on commit ca422c9

Please sign in to comment.