<commit_before><?php
/**
 *@file
 * Contains \Drupal\AppConsole\Generator\CommandGenerator.
 */

namespace Drupal\AppConsole\Generator;

class CommandGenerator extends Generator
{
  /**
   * Generator Plugin Block
   * @param  string $module     Module name
   * @param  string $command    Command name
   * @param  string $class_name class name for plugin block
   * @param  array  $container  Access to container class
   */
  public function generate($module, $command, $class_name, $container)
  {

    $parameters = [
      'module_name' => $module,
      'command'     => $command,
      'name'        => [
        'class'     => $class_name,
      ],
      'container'   => $container,
    ];

    $this->renderFile(
      'module/src/Command/command.php.twig',
      $this->getCommandPath($module).'/'.$class_name.'.php',
      $parameters
    );
  }
}<commit_msg>Add translation messages to generated command<commit_after><?php
/**
 *@file
 * Contains \Drupal\AppConsole\Generator\CommandGenerator.
 */

namespace Drupal\AppConsole\Generator;

class CommandGenerator extends Generator
{
  /**
   * Generator Plugin Block
   * @param  string $module     Module name
   * @param  string $command    Command name
   * @param  string $class_name class name for plugin block
   * @param  array  $container  Access to container class
   */
  public function generate($module, $command, $class_name, $container)
  {

    $command_key_root = 'command.' . str_replace(':','.', $command);

    $parameters = [
      'module_name' => $module,
      'command'     => $command,
      'name'        => [
        'class'     => $class_name,
      ],
      'container'   => $container,
      'command_key_root' => $command_key_root
    ];

    $messages[$command_key_root . '.description'] =  'Greet someone';
    $messages[$command_key_root . '.arguments.name'] =  'Who do you want to greet?';
    $messages[$command_key_root . '.options.yell'] =  'If set, the task will yell in uppercase letters';

    $translator = $this->getTranslator();
    $translator->writeTranslationsByModule($module, $messages);

    $this->renderFile(
      'module/src/Command/command.php.twig',
      $this->getCommandPath($module).'/'.$class_name.'.php',
      $parameters
    );
  }
}
{'fraction_non_alphanumeric': 0.1415929203539823, 'fraction_numerical': 0.0, 'mean_word_length': 2.911764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '108936', 'n_tokens_mistral': 695, 'n_tokens_neox': 690, 'n_words': 154}