Skip to content

Commit

Permalink
Remving calls to translationfunctions in the console
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 30, 2014
1 parent 0041767 commit cf01d37
Show file tree
Hide file tree
Showing 22 changed files with 228 additions and 233 deletions.
26 changes: 13 additions & 13 deletions src/Console/Command/BakeShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ public function startup() {
public function main() {
$connections = ConnectionManager::configured();
if (empty($connections)) {
$this->out(__d('cake_console', 'Your database configuration was not found.'));
$this->out(__d('cake_console', 'Add your database connection information to App/Config/app.php.'));
$this->out('Your database configuration was not found.');
$this->out('Add your database connection information to App/Config/app.php.');
return false;
}
$this->out(__d('cake_console', 'The following commands can be used to generate skeleton code for your application.'));
$this->out('The following commands can be used to generate skeleton code for your application.');
$this->out('');
$this->out(__d('cake_console', '<info>Available bake commands:</info>'));
$this->out('<info>Available bake commands:</info>');
$this->out('');
foreach ($this->tasks as $task) {
list($p, $name) = pluginSplit($task);
$this->out('- ' . Inflector::underscore($name));
}
$this->out('');
$this->out(__d('cake_console', 'By using <info>Console/cake bake [name]</info> you can invoke a specific bake task.'));
$this->out('By using <info>Console/cake bake [name]</info> you can invoke a specific bake task.');
}

/**
Expand Down Expand Up @@ -201,11 +201,11 @@ public function all($name = null) {

if (empty($name)) {
$this->Model->connection = $this->connection;
$this->out(__d('cake_console', 'Possible model names based on your database:'));
$this->out('Possible model names based on your database:');
foreach ($this->Model->listAll() as $table) {
$this->out('- ' . $table);
}
$this->out(__d('cake_console', 'Run <info>cake bake all [name]</info> to generate skeleton files.'));
$this->out('Run <info>cake bake all [name]</info> to generate skeleton files.');
return false;
}

Expand All @@ -220,7 +220,7 @@ public function all($name = null) {

$this->View->main($name);

$this->out(__d('cake_console', '<success>Bake All complete.</success>'), 1, Shell::QUIET);
$this->out('<success>Bake All complete.</success>', 1, Shell::QUIET);
return true;
}

Expand All @@ -233,18 +233,18 @@ public function getOptionParser() {
$parser = parent::getOptionParser();

$parser->description(
__d('cake_console', 'The Bake script generates controllers, views and models for your application.' .
'The Bake script generates controllers, views and models for your application.' .
' If run with no command line arguments, Bake guides the user through the class creation process.' .
' You can customize the generation process by telling Bake where different parts of your application are using command line arguments.'
))->addSubcommand('all', [
'help' => __d('cake_console', 'Bake a complete MVC skeleton. Optional: <name> of a model.'),
)->addSubcommand('all', [
'help' => 'Bake a complete MVC skeleton. Optional: <name> of a model.',
])->addOption('connection', [
'help' => __d('cake_console', 'Database connection to use in conjunction with `bake all`.'),
'help' => 'Database connection to use in conjunction with `bake all`.',
'short' => 'c',
'default' => 'default'
])->addOption('theme', [
'short' => 't',
'help' => __d('cake_console', 'Theme to use when baking code.')
'help' => 'Theme to use when baking code.'
]);

foreach ($this->_taskMap as $task => $config) {
Expand Down
14 changes: 7 additions & 7 deletions src/Console/Command/CommandListShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public function startup() {
*/
public function main() {
if (empty($this->params['xml'])) {
$this->out(__d('cake_console', "<info>Current Paths:</info>"), 2);
$this->out("<info>Current Paths:</info>", 2);
$this->out("* app: " . APP_DIR);
$this->out("* root: " . rtrim(ROOT, DS));
$this->out("* core: " . rtrim(CORE_PATH, DS));
$this->out("");

$this->out(__d('cake_console', "<info>Available Shells:</info>"), 2);
$this->out("<info>Available Shells:</info>", 2);
}

$shellList = $this->Command->getShellList();
Expand Down Expand Up @@ -84,9 +84,9 @@ protected function _asText($shellList) {
$this->out();
}

$this->out(__d('cake_console', "To run an app or core command, type <info>cake shell_name [args]</info>"));
$this->out(__d('cake_console', "To run a plugin command, type <info>cake Plugin.shell_name [args]</info>"));
$this->out(__d('cake_console', "To get help on a specific command, type <info>cake shell_name --help</info>"), 2);
$this->out("To run an app or core command, type <info>cake shell_name [args]</info>");
$this->out("To run a plugin command, type <info>cake Plugin.shell_name [args]</info>");
$this->out("To get help on a specific command, type <info>cake shell_name --help</info>", 2);
}

/**
Expand Down Expand Up @@ -125,9 +125,9 @@ public function getOptionParser() {
$parser = parent::getOptionParser();

$parser->description(
__d('cake_console', 'Get the list of available shells for this CakePHP application.')
'Get the list of available shells for this CakePHP application.'
)->addOption('xml', [
'help' => __d('cake_console', 'Get the listing as XML.'),
'help' => 'Get the listing as XML.',
'boolean' => true
]);

Expand Down
22 changes: 11 additions & 11 deletions src/Console/Command/CompletionShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,38 +102,38 @@ public function getOptionParser() {
$parser = parent::getOptionParser();

$parser->description(
__d('cake_console', 'Used by shells like bash to autocomplete command name, options and arguments')
'Used by shells like bash to autocomplete command name, options and arguments'
)->addSubcommand('commands', [
'help' => __d('cake_console', 'Output a list of available commands'),
'help' => 'Output a list of available commands',
'parser' => [
'description' => __d('cake_console', 'List all availables'),
'description' => 'List all availables',
]
])->addSubcommand('subcommands', [
'help' => __d('cake_console', 'Output a list of available subcommands'),
'help' => 'Output a list of available subcommands',
'parser' => [
'description' => __d('cake_console', 'List subcommands for a command'),
'description' => 'List subcommands for a command',
'arguments' => [
'command' => [
'help' => __d('cake_console', 'The command name'),
'help' => 'The command name',
'required' => false,
]
]
]
])->addSubcommand('options', [
'help' => __d('cake_console', 'Output a list of available options'),
'help' => 'Output a list of available options',
'parser' => [
'description' => __d('cake_console', 'List options'),
'description' => 'List options',
'arguments' => [
'command' => [
'help' => __d('cake_console', 'The command name'),
'help' => 'The command name',
'required' => false,
]
]
]
])->addSubcommand('fuzzy', [
'help' => __d('cake_console', 'Guess autocomplete')
'help' => 'Guess autocomplete'
])->epilog([
__d('cake_console', 'This command is not intended to be called manually'),
'This command is not intended to be called manually',
]);

return $parser;
Expand Down
16 changes: 8 additions & 8 deletions src/Console/Command/I18nShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class I18nShell extends Shell {
* @return void
*/
public function main() {
$this->out(__d('cake_console', '<info>I18n Shell</info>'));
$this->out('<info>I18n Shell</info>');
$this->hr();
$this->out(__d('cake_console', '[E]xtract POT file from sources'));
$this->out(__d('cake_console', '[H]elp'));
$this->out(__d('cake_console', '[Q]uit'));
$this->out('[E]xtract POT file from sources');
$this->out('[H]elp');
$this->out('[Q]uit');

$choice = strtolower($this->in(__d('cake_console', 'What would you like to do?'), ['E', 'H', 'Q']));
$choice = strtolower($this->in('What would you like to do?', ['E', 'H', 'Q']));
switch ($choice) {
case 'e':
$this->Extract->execute();
Expand All @@ -54,7 +54,7 @@ public function main() {
case 'q':
return $this->_stop();
default:
$this->out(__d('cake_console', 'You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
$this->out('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.');
}
$this->hr();
$this->main();
Expand All @@ -69,9 +69,9 @@ public function getOptionParser() {
$parser = parent::getOptionParser();

$parser->description(
__d('cake_console', 'I18n Shell generates .pot files(s) with translations.')
'I18n Shell generates .pot files(s) with translations.'
)->addSubcommand('extract', [
'help' => __d('cake_console', 'Extract the po translations from your application'),
'help' => 'Extract the po translations from your application',
'parser' => $this->Extract->getOptionParser()
]);

Expand Down
22 changes: 11 additions & 11 deletions src/Console/Command/ServerShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public function startup() {
*/
protected function _welcome() {
$this->out();
$this->out(__d('cake_console', '<info>Welcome to CakePHP %s Console</info>', 'v' . Configure::version()));
$this->out('<info>Welcome to CakePHP %s Console</info>', 'v' . Configure::version());
$this->hr();
$this->out(__d('cake_console', 'App : %s', APP_DIR));
$this->out(__d('cake_console', 'Path: %s', APP));
$this->out(__d('cake_console', 'DocumentRoot: %s', $this->_documentRoot));
$this->out('App : %s', APP_DIR);
$this->out('Path: %s', APP);
$this->out('DocumentRoot: %s', $this->_documentRoot);
$this->hr();
}

Expand All @@ -131,8 +131,8 @@ public function main() {
);

$port = ($this->_port == static::DEFAULT_PORT) ? '' : ':' . $this->_port;
$this->out(__d('cake_console', 'built-in server is running in http://%s%s/', $this->_host, $port));
$this->out(__d('cake_console', 'You can exit with <info>CTRL-C</info>'));
$this->out(sprintf('built-in server is running in http://%s%s/', $this->_host, $port));
$this->out(sprintf('You can exit with <info>CTRL-C</info>'));
system($command);
}

Expand All @@ -145,17 +145,17 @@ public function getOptionParser() {
$parser = parent::getOptionParser();

$parser->description([
__d('cake_console', 'PHP Built-in Server for CakePHP'),
__d('cake_console', '<warning>[WARN] Don\'t use this at the production environment</warning>'),
'PHP Built-in Server for CakePHP',
'<warning>[WARN] Don\'t use this at the production environment</warning>',
])->addOption('host', [
'short' => 'H',
'help' => __d('cake_console', 'ServerHost')
'help' => 'ServerHost'
])->addOption('port', [
'short' => 'p',
'help' => __d('cake_console', 'ListenPort')
'help' => 'ListenPort'
])->addOption('document_root', [
'short' => 'd',
'help' => __d('cake_console', 'DocumentRoot')
'help' => 'DocumentRoot'
]);

return $parser;
Expand Down
10 changes: 5 additions & 5 deletions src/Console/Command/Task/BakeTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function callProcess($command) {
$pipes
);
if (!is_resource($process)) {
$this->error(__d('cake_console', 'Could not start subprocess.'));
$this->error('Could not start subprocess.');
return false;
}
$output = $error = '';
Expand Down Expand Up @@ -168,19 +168,19 @@ public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->addOption('plugin', [
'short' => 'p',
'help' => __d('cake_console', 'Plugin to bake into.')
'help' => 'Plugin to bake into.'
])->addOption('force', [
'short' => 'f',
'boolean' => true,
'help' => __d('cake_console', 'Force overwriting existing files without prompting.')
'help' => 'Force overwriting existing files without prompting.'
])->addOption('connection', [
'short' => 'c',
'default' => 'default',
'help' => __d('cake_console', 'The datasource connection to get data from.')
'help' => 'The datasource connection to get data from.'
])->addOption('theme', [
'short' => 't',
'default' => 'default',
'help' => __d('cake_console', 'Theme to use when baking code.')
'help' => 'Theme to use when baking code.'
]);
return $parser;
}
Expand Down
20 changes: 10 additions & 10 deletions src/Console/Command/Task/ControllerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function main($name = null) {
$name = $this->_getName($name);

if (empty($name)) {
$this->out(__d('cake_console', 'Possible controllers based on your current database:'));
$this->out('Possible controllers based on your current database:');
foreach ($this->listAll() as $table) {
$this->out('- ' . $this->_controllerName($table));
}
Expand Down Expand Up @@ -113,7 +113,7 @@ public function bakeActions($controllerName) {
* @return string Baked controller
*/
public function bake($controllerName) {
$this->out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET);
$this->out("\n" . sprintf('Baking controller class for %s...', $controllerName), 1, Shell::QUIET);

$actions = $this->bakeActions($controllerName);
$helpers = $this->getHelpers();
Expand Down Expand Up @@ -249,23 +249,23 @@ public function listAll() {
public function getOptionParser() {
$parser = parent::getOptionParser();
$parser->description(
__d('cake_console', 'Bake a controller skeleton.')
'Bake a controller skeleton.'
)->addArgument('name', [
'help' => __d('cake_console', 'Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.')
'help' => 'Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.'
])->addOption('components', [
'help' => __d('cake_console', 'The comma separated list of components to use.')
'help' => 'The comma separated list of components to use.'
])->addOption('helpers', [
'help' => __d('cake_console', 'The comma separated list of helpers to use.')
'help' => 'The comma separated list of helpers to use.'
])->addOption('prefix', [
'help' => __d('cake_console', 'The namespace/routing prefix to use.')
'help' => 'The namespace/routing prefix to use.'
])->addOption('no-test', [
'boolean' => true,
'help' => __d('cake_console', 'Do not generate a test skeleton.')
'help' => 'Do not generate a test skeleton.'
])->addOption('no-actions', [
'boolean' => true,
'help' => __d('cake_console', 'Do not generate basic CRUD action methods.')
'help' => 'Do not generate basic CRUD action methods.'
])->addSubcommand('all', [
'help' => __d('cake_console', 'Bake all controllers with CRUD methods.')
'help' => 'Bake all controllers with CRUD methods.'
]);

return $parser;
Expand Down
Loading

0 comments on commit cf01d37

Please sign in to comment.