5 * Contains \Drupal\Console\Command\MigrateDebugCommand.
8 namespace Drupal\Console\Command\Locale;
10 use Symfony\Component\Console\Input\InputArgument;
11 use Symfony\Component\Console\Input\InputInterface;
12 use Symfony\Component\Console\Output\OutputInterface;
13 use Drupal\Console\Core\Command\Command;
14 use Drupal\Console\Command\Shared\LocaleTrait;
15 use Drupal\Console\Utils\Site;
16 use Drupal\Console\Extension\Manager;
17 use Drupal\Console\Annotations\DrupalCommand;
21 * extension = "locale",
22 * extensionType = "module"
25 class TranslationStatusCommand extends Command
37 protected $extensionManager;
40 * TranslationStatusCommand constructor.
43 * @param Manager $extensionManager
45 public function __construct(
47 Manager $extensionManager
50 $this->extensionManager = $extensionManager;
51 parent::__construct();
54 protected function configure()
57 ->setName('locale:translation:status')
58 ->setDescription($this->trans('commands.locale.translation.status.description'))
61 InputArgument::OPTIONAL,
62 $this->trans('commands.locale.translation.status.arguments.language')
66 protected function execute(InputInterface $input, OutputInterface $output)
68 $language = $input->getArgument('language');
70 $this->trans('commands.locale.translation.status.messages.project'),
71 $this->trans('commands.locale.translation.status.messages.version'),
72 $this->trans('commands.locale.translation.status.messages.local-age'),
73 $this->trans('commands.locale.translation.status.messages.remote-age'),
74 $this->trans('commands.locale.translation.status.messages.info'),
77 $locale = $this->extensionManager->getModule('locale');
78 $this->site->loadLegacyFile($locale->getPath(true) . '/locale.compare.inc');
80 $languages = locale_translatable_language_list();
81 $status = locale_translation_get_status();
84 $this->getIo()->info($this->trans('commands.locale.translation.status.messages.no-languages'));
89 $this->getIo()->info($this->trans('commands.locale.translation.status.messages.no-translations'));
94 $projectsStatus = $this->projectsStatus();
96 foreach ($projectsStatus as $langcode => $rows) {
98 if ($language !='' && !($language == $langcode || strtolower($language) == strtolower($languages[$langcode]->getName()))) {
101 $this->getIo()->info($languages[$langcode]->getName());
102 foreach ($rows as $row) {
103 if ($row[0] == 'drupal') {
104 $row[0] = $this->trans('commands.common.messages.drupal-core');
108 $this->getIo()->table($tableHeader, $tableRows, 'compact');