Skip to content

Commit

Permalink
Add Message to run 'composer require drupal/console-language'. (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertomangones authored and enzolutions committed Sep 25, 2019
1 parent 1d2d579 commit ddf1730
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Utils/TranslatorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ private function buildCoreLanguageDirectory(
$language,
$directoryRoot
) {
$output = new ConsoleOutput();
$input = new ArrayInput([]);
$io = new DrupalStyle($input, $output);

$coreLanguageDirectory =
$directoryRoot .
sprintf(
Expand All @@ -126,6 +130,12 @@ private function buildCoreLanguageDirectory(
if (!isset($languageDirectory)) {
if ($language == 'en') {
throw new \Exception('No languages found. Make sure you have installed a console language package in a supported directory');
}else{
$io->warning(
sprintf(
'Language not available please execute this command in order to get the language locally using composer, run composer require drupal/console-'.$language.''
)
);
}
return $this->buildCoreLanguageDirectory('en', $directoryRoot);
}
Expand Down

0 comments on commit ddf1730

Please sign in to comment.