Browse Source

Remving calls to translationfunctions in the console

Jose Lorenzo Rodriguez 11 years ago
parent
commit
cf01d37b5a

+ 13 - 13
src/Console/Command/BakeShell.php

@@ -72,20 +72,20 @@ class BakeShell extends Shell {
 	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.');
 	}
 
 /**
@@ -201,11 +201,11 @@ class BakeShell extends Shell {
 
 		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;
 		}
 
@@ -220,7 +220,7 @@ class BakeShell extends Shell {
 
 		$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;
 	}
 
@@ -233,18 +233,18 @@ class BakeShell extends Shell {
 		$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) {

+ 7 - 7
src/Console/Command/CommandListShell.php

@@ -50,13 +50,13 @@ class CommandListShell extends Shell {
  */
 	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();
@@ -84,9 +84,9 @@ class CommandListShell extends Shell {
 			$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);
 	}
 
 /**
@@ -125,9 +125,9 @@ class CommandListShell extends Shell {
 		$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
 		]);
 

+ 11 - 11
src/Console/Command/CompletionShell.php

@@ -102,38 +102,38 @@ class CompletionShell extends Shell {
 		$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;

+ 8 - 8
src/Console/Command/I18nShell.php

@@ -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();
@@ -54,7 +54,7 @@ class I18nShell extends Shell {
 			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();
@@ -69,9 +69,9 @@ class I18nShell extends Shell {
 		$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()
 		]);
 

+ 11 - 11
src/Console/Command/ServerShell.php

@@ -109,11 +109,11 @@ class ServerShell extends Shell {
  */
 	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();
 	}
 
@@ -131,8 +131,8 @@ class ServerShell extends Shell {
 		);
 
 		$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);
 	}
 
@@ -145,17 +145,17 @@ class ServerShell extends Shell {
 		$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;

+ 5 - 5
src/Console/Command/Task/BakeTask.php

@@ -121,7 +121,7 @@ class BakeTask extends Shell {
 			$pipes
 		);
 		if (!is_resource($process)) {
-			$this->error(__d('cake_console', 'Could not start subprocess.'));
+			$this->error('Could not start subprocess.');
 			return false;
 		}
 		$output = $error = '';
@@ -168,19 +168,19 @@ class BakeTask extends Shell {
 		$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;
 	}

+ 10 - 10
src/Console/Command/Task/ControllerTask.php

@@ -49,7 +49,7 @@ class ControllerTask extends BakeTask {
 		$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));
 			}
@@ -113,7 +113,7 @@ class ControllerTask extends BakeTask {
  * @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();
@@ -249,23 +249,23 @@ class ControllerTask extends BakeTask {
 	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;

+ 33 - 34
src/Console/Command/Task/ExtractTask.php

@@ -113,25 +113,24 @@ class ExtractTask extends Shell {
 		$defaultPath = APP;
 		while (true) {
 			$currentPaths = count($this->_paths) > 0 ? $this->_paths : ['None'];
-			$message = __d(
-				'cake_console',
+			$message = sprintf(
 				"Current paths: %s\nWhat is the path you would like to extract?\n[Q]uit [D]one",
 				implode(', ', $currentPaths)
 			);
 			$response = $this->in($message, null, $defaultPath);
 			if (strtoupper($response) === 'Q') {
-				$this->err(__d('cake_console', 'Extract Aborted'));
+				$this->err('Extract Aborted');
 				return $this->_stop();
 			} elseif (strtoupper($response) === 'D' && count($this->_paths)) {
 				$this->out();
 				return;
 			} elseif (strtoupper($response) === 'D') {
-				$this->err(__d('cake_console', '<warning>No directories selected.</warning> Please choose a directory.'));
+				$this->err('<warning>No directories selected.</warning> Please choose a directory.');
 			} elseif (is_dir($response)) {
 				$this->_paths[] = $response;
 				$defaultPath = 'D';
 			} else {
-				$this->err(__d('cake_console', 'The directory path you supplied was not found. Please try again.'));
+				$this->err('The directory path you supplied was not found. Please try again.');
 			}
 			$this->out();
 		}
@@ -165,7 +164,7 @@ class ExtractTask extends Shell {
 		if (isset($this->params['extract-core'])) {
 			$this->_extractCore = !(strtolower($this->params['extract-core']) === 'no');
 		} else {
-			$response = $this->in(__d('cake_console', 'Would you like to extract the messages from the CakePHP core?'), ['y', 'n'], 'n');
+			$response = $this->in('Would you like to extract the messages from the CakePHP core?', ['y', 'n'], 'n');
 			$this->_extractCore = strtolower($response) === 'y';
 		}
 
@@ -190,17 +189,17 @@ class ExtractTask extends Shell {
 		} elseif (isset($this->params['plugin'])) {
 			$this->_output = $this->_paths[0] . DS . 'Locale';
 		} else {
-			$message = __d('cake_console', "What is the path you would like to output?\n[Q]uit", $this->_paths[0] . DS . 'Locale');
+			$message = "What is the path you would like to output?\n[Q]uit";
 			while (true) {
 				$response = $this->in($message, null, rtrim($this->_paths[0], DS) . DS . 'Locale');
 				if (strtoupper($response) === 'Q') {
-					$this->err(__d('cake_console', 'Extract Aborted'));
+					$this->err('Extract Aborted');
 					return $this->_stop();
 				} elseif ($this->_isPathUsable($response)) {
 					$this->_output = $response . DS;
 					break;
 				} else {
-					$this->err(__d('cake_console', 'The directory path you supplied was not found. Please try again.'));
+					$this->err('The directory path you supplied was not found. Please try again.');
 				}
 				$this->out();
 			}
@@ -210,7 +209,7 @@ class ExtractTask extends Shell {
 			$this->_merge = !(strtolower($this->params['merge']) === 'no');
 		} else {
 			$this->out();
-			$response = $this->in(__d('cake_console', 'Would you like to merge all domain strings into the default.pot file?'), ['y', 'n'], 'n');
+			$response = $this->in('Would you like to merge all domain strings into the default.pot file?', ['y', 'n'], 'n');
 			$this->_merge = strtolower($response) === 'y';
 		}
 
@@ -220,7 +219,7 @@ class ExtractTask extends Shell {
 
 		$this->_output = rtrim($this->_output, DS) . DS;
 		if (!$this->_isPathUsable($this->_output)) {
-			$this->err(__d('cake_console', 'The output directory %s was not found or writable.', $this->_output));
+			$this->err(sprintf('The output directory %s was not found or writable.', $this->_output));
 			return $this->_stop();
 		}
 
@@ -269,13 +268,13 @@ class ExtractTask extends Shell {
 	protected function _extract() {
 		$this->out();
 		$this->out();
-		$this->out(__d('cake_console', 'Extracting...'));
+		$this->out('Extracting...');
 		$this->hr();
-		$this->out(__d('cake_console', 'Paths:'));
+		$this->out('Paths:');
 		foreach ($this->_paths as $path) {
 			$this->out('   ' . $path);
 		}
-		$this->out(__d('cake_console', 'Output Directory: ') . $this->_output);
+		$this->out('Output Directory: ' . $this->_output);
 		$this->hr();
 		$this->_extractTokens();
 		$this->_buildFiles();
@@ -283,7 +282,7 @@ class ExtractTask extends Shell {
 		$this->_paths = $this->_files = $this->_storage = [];
 		$this->_translations = $this->_tokens = [];
 		$this->out();
-		$this->out(__d('cake_console', 'Done.'));
+		$this->out('Done.');
 	}
 
 /**
@@ -294,41 +293,41 @@ class ExtractTask extends Shell {
 	public function getOptionParser() {
 		$parser = parent::getOptionParser();
 		$parser->description(
-			__d('cake_console', 'CakePHP Language String Extraction:')
+			'CakePHP Language String Extraction:'
 		)->addOption('app', [
-			'help' => __d('cake_console', 'Directory where your application is located.')
+			'help' => 'Directory where your application is located.'
 		])->addOption('paths', [
-			'help' => __d('cake_console', 'Comma separated list of paths.')
+			'help' => 'Comma separated list of paths.'
 		])->addOption('merge', [
-			'help' => __d('cake_console', 'Merge all domain strings into the default.po file.'),
+			'help' => 'Merge all domain strings into the default.po file.',
 			'choices' => ['yes', 'no']
 		])->addOption('output', [
-			'help' => __d('cake_console', 'Full path to output directory.')
+			'help' => 'Full path to output directory.'
 		])->addOption('files', [
-			'help' => __d('cake_console', 'Comma separated list of files.')
+			'help' => 'Comma separated list of files.'
 		])->addOption('exclude-plugins', [
 			'boolean' => true,
 			'default' => true,
-			'help' => __d('cake_console', 'Ignores all files in plugins if this command is run inside from the same app directory.')
+			'help' => 'Ignores all files in plugins if this command is run inside from the same app directory.'
 		])->addOption('plugin', [
-			'help' => __d('cake_console', 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.')
+			'help' => 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.'
 		])->addOption('ignore-model-validation', [
 			'boolean' => true,
 			'default' => false,
-			'help' => __d('cake_console', 'Ignores validation messages in the $validate property.' .
+			'help' => 'Ignores validation messages in the $validate property.' .
 				' If this flag is not set and the command is run from the same app directory,' .
-				' all messages in model validation rules will be extracted as tokens.')
+				' all messages in model validation rules will be extracted as tokens.'
 		])->addOption('validation-domain', [
-			'help' => __d('cake_console', 'If set to a value, the localization domain to be used for model validation messages.')
+			'help' => 'If set to a value, the localization domain to be used for model validation messages.'
 		])->addOption('exclude', [
-			'help' => __d('cake_console', 'Comma separated list of directories to exclude.' .
-				' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')
+			'help' => 'Comma separated list of directories to exclude.' .
+				' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors'
 		])->addOption('overwrite', [
 			'boolean' => true,
 			'default' => false,
-			'help' => __d('cake_console', 'Always overwrite existing .pot files.')
+			'help' => 'Always overwrite existing .pot files.'
 		])->addOption('extract-core', [
-			'help' => __d('cake_console', 'Extract messages from the CakePHP core libs.'),
+			'help' => 'Extract messages from the CakePHP core libs.',
 			'choices' => ['yes', 'no']
 		]);
 
@@ -343,7 +342,7 @@ class ExtractTask extends Shell {
 	protected function _extractTokens() {
 		foreach ($this->_files as $file) {
 			$this->_file = $file;
-			$this->out(__d('cake_console', 'Processing %s...', $file));
+			$this->out('Processing %s...', $file);
 
 			$code = file_get_contents($file);
 			$allTokens = token_get_all($code);
@@ -505,14 +504,14 @@ class ExtractTask extends Shell {
 			while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') {
 				$this->out();
 				$response = $this->in(
-					__d('cake_console', 'Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', $filename),
+					sprintf('Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', $filename),
 					['y', 'n', 'a'],
 					'y'
 				);
 				if (strtoupper($response) === 'N') {
 					$response = '';
 					while (!$response) {
-						$response = $this->in(__d('cake_console', "What would you like to name this file?"), null, 'new_' . $filename);
+						$response = $this->in("What would you like to name this file?", null, 'new_' . $filename);
 						$File = new File($this->_output . $response);
 						$filename = $response;
 					}
@@ -608,7 +607,7 @@ class ExtractTask extends Shell {
  * @return void
  */
 	protected function _markerError($file, $line, $marker, $count) {
-		$this->err(__d('cake_console', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker));
+		$this->err(sprintf("Invalid marker content in %s:%s\n* %s(", $file, $line, $marker));
 		$count += 2;
 		$tokenCount = count($this->_tokens);
 		$parenthesis = 1;

+ 9 - 9
src/Console/Command/Task/FixtureTask.php

@@ -57,25 +57,25 @@ class FixtureTask extends BakeTask {
 		$parser = parent::getOptionParser();
 
 		$parser = $parser->description(
-			__d('cake_console', 'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.')
+			'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.'
 		)->addArgument('name', [
-			'help' => __d('cake_console', 'Name of the fixture to bake. Can use Plugin.name to bake plugin fixtures.')
+			'help' => 'Name of the fixture to bake. Can use Plugin.name to bake plugin fixtures.'
 		])->addOption('table', [
-			'help' => __d('cake_console', 'The table name if it does not follow conventions.'),
+			'help' => 'The table name if it does not follow conventions.',
 		])->addOption('count', [
-			'help' => __d('cake_console', 'When using generated data, the number of records to include in the fixture(s).'),
+			'help' => 'When using generated data, the number of records to include in the fixture(s).',
 			'short' => 'n',
 			'default' => 10
 		])->addOption('schema', [
-			'help' => __d('cake_console', 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.'),
+			'help' => 'Create a fixture that imports schema, instead of dumping a schema snapshot into the fixture.',
 			'short' => 's',
 			'boolean' => true
 		])->addOption('records', [
-			'help' => __d('cake_console', 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10.'),
+			'help' => 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10.',
 			'short' => 'r',
 			'boolean' => true
 		])->addOption('conditions', [
-			'help' => __d('cake_console', 'The SQL snippet to use when importing records.'),
+			'help' => 'The SQL snippet to use when importing records.',
 			'default' => '1=1',
 		]);
 
@@ -94,7 +94,7 @@ class FixtureTask extends BakeTask {
 		$name = $this->_getName($name);
 
 		if (empty($name)) {
-			$this->out(__d('cake_console', 'Choose a fixture to bake from the following:'));
+			$this->out('Choose a fixture to bake from the following:');
 			foreach ($this->Model->listAll() as $table) {
 				$this->out('- ' . $this->_modelName($table));
 			}
@@ -235,7 +235,7 @@ class FixtureTask extends BakeTask {
 		$this->Template->set($vars);
 		$content = $this->Template->generate('classes', 'fixture');
 
-		$this->out("\n" . __d('cake_console', 'Baking test fixture for %s...', $model), 1, Shell::QUIET);
+		$this->out("\n" . sprintf('Baking test fixture for %s...', $model), 1, Shell::QUIET);
 		$this->createFile($path . $filename, $content);
 		return $content;
 	}

+ 27 - 30
src/Console/Command/Task/ModelTask.php

@@ -79,7 +79,7 @@ class ModelTask extends BakeTask {
 		$name = $this->_getName($name);
 
 		if (empty($name)) {
-			$this->out(__d('cake_console', 'Choose a model to bake from the following:'));
+			$this->out('Choose a model to bake from the following:');
 			foreach ($this->listAll() as $table) {
 				$this->out('- ' . $this->_modelName($table));
 			}
@@ -130,7 +130,7 @@ class ModelTask extends BakeTask {
 				continue;
 			}
 			$modelClass = $this->_modelName($table);
-			$this->out(__d('cake_console', 'Baking %s', $modelClass));
+			$this->out('Baking %s', $modelClass);
 			$this->bake($modelClass);
 		}
 	}
@@ -163,7 +163,7 @@ class ModelTask extends BakeTask {
 		if (!empty($this->params['no-associations'])) {
 			return [];
 		}
-		$this->out(__d('cake_console', 'One moment while associations are detected.'));
+		$this->out('One moment while associations are detected.');
 
 		$this->listAll();
 
@@ -175,10 +175,9 @@ class ModelTask extends BakeTask {
 
 		$primary = $table->primaryKey();
 		if (is_array($primary) && count($primary) > 1) {
-			$this->err(__d(
-				'cake_console',
+			$this->err(
 				'<warning>Bake cannot generate associations for composite primary keys at this time</warning>.'
-			));
+			);
 			return $associations;
 		}
 
@@ -603,7 +602,7 @@ class ModelTask extends BakeTask {
 
 		$path = $this->getPath();
 		$filename = $path . 'Entity' . DS . $name . '.php';
-		$this->out("\n" . __d('cake_console', 'Baking entity class for %s...', $name), 1, Shell::QUIET);
+		$this->out("\n" . sprintf('Baking entity class for %s...', $name), 1, Shell::QUIET);
 		$this->createFile($filename, $out);
 		return $out;
 	}
@@ -646,7 +645,7 @@ class ModelTask extends BakeTask {
 
 		$path = $this->getPath();
 		$filename = $path . 'Table' . DS . $name . 'Table.php';
-		$this->out("\n" . __d('cake_console', 'Baking table class for %s...', $name), 1, Shell::QUIET);
+		$this->out("\n" . sprintf('Baking table class for %s...', $name), 1, Shell::QUIET);
 		$this->createFile($filename, $out);
 		return $out;
 	}
@@ -681,16 +680,15 @@ class ModelTask extends BakeTask {
 		$tables = [];
 		$db = ConnectionManager::get($this->connection);
 		if (!method_exists($db, 'schemaCollection')) {
-			$this->err(__d(
-				'cake_console',
+			$this->err(
 				'Connections need to implement schemaCollection() to be used with bake.'
-			));
+			);
 			return $this->_stop();
 		}
 		$schema = $db->schemaCollection();
 		$tables = $schema->listTables();
 		if (empty($tables)) {
-			$this->err(__d('cake_console', 'Your database does not have any tables.'));
+			$this->err('Your database does not have any tables.');
 			return $this->_stop();
 		}
 		sort($tables);
@@ -721,48 +719,47 @@ class ModelTask extends BakeTask {
 		$parser = parent::getOptionParser();
 
 		$parser->description(
-			__d('cake_console', 'Bake table and entity classes.')
+			'Bake table and entity classes.'
 		)->addArgument('name', [
-			'help' => __d('cake_console', 'Name of the model to bake. Can use Plugin.name to bake plugin models.')
+			'help' => 'Name of the model to bake. Can use Plugin.name to bake plugin models.'
 		])->addSubcommand('all', [
-			'help' => __d('cake_console', 'Bake all model files with associations and validation.')
+			'help' => 'Bake all model files with associations and validation.'
 		])->addOption('table', [
-			'help' => __d('cake_console', 'The table name to use if you have non-conventional table names.')
+			'help' => 'The table name to use if you have non-conventional table names.'
 		])->addOption('no-entity', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating an entity class.')
+			'help' => 'Disable generating an entity class.'
 		])->addOption('no-table', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating a table class.')
+			'help' => 'Disable generating a table class.'
 		])->addOption('no-validation', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating validation rules.')
+			'help' => 'Disable generating validation rules.'
 		])->addOption('no-associations', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating associations.')
+			'help' => 'Disable generating associations.'
 		])->addOption('no-fields', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating accessible fields in the entity.')
+			'help' => 'Disable generating accessible fields in the entity.'
 		])->addOption('fields', [
-			'help' => __d('cake_console', 'A comma separated list of fields to make accessible.')
+			'help' => 'A comma separated list of fields to make accessible.'
 		])->addOption('no-hidden', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Disable generating hidden fields in the entity.')
+			'help' => 'Disable generating hidden fields in the entity.'
 		])->addOption('hidden', [
-			'help' => __d('cake_console', 'A comma separated list of fields to hide.')
+			'help' => 'A comma separated list of fields to hide.'
 		])->addOption('primary-key', [
-			'help' => __d('cake_console', 'The primary key if you would like to manually set one. Can be a comma separated list if you are using a composite primary key.')
+			'help' => 'The primary key if you would like to manually set one. Can be a comma separated list if you are using a composite primary key.'
 		])->addOption('display-field', [
-			'help' => __d('cake_console', 'The displayField if you would like to choose one.')
+			'help' => 'The displayField if you would like to choose one.'
 		])->addOption('no-test', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Do not generate a test case skeleton.')
+			'help' => 'Do not generate a test case skeleton.'
 		])->addOption('no-fixture', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Do not generate a test fixture skeleton.')
+			'help' => 'Do not generate a test fixture skeleton.'
 		])->epilog(
-			__d('cake_console', 'Omitting all arguments and options will list ' .
-				'the table names you can generate models for')
+			'Omitting all arguments and options will list the table names you can generate models for'
 		);
 
 		return $parser;

+ 18 - 18
src/Console/Command/Task/PluginTask.php

@@ -65,12 +65,12 @@ class PluginTask extends BakeTask {
 		$plugin = $this->_camelize($name);
 		$pluginPath = $this->_pluginPath($plugin);
 		if (is_dir($pluginPath)) {
-			$this->out(__d('cake_console', 'Plugin: %s already exists, no action taken', $plugin));
-			$this->out(__d('cake_console', 'Path: %s', $pluginPath));
+			$this->out(sprintf('Plugin: %s already exists, no action taken', $plugin));
+			$this->out(sprintf('Path: %s', $pluginPath));
 			return false;
 		}
 		if (!$this->bake($plugin)) {
-			$this->error(__d('cake_console', "An error occurred trying to bake: %s in %s", $plugin, $this->path . $plugin));
+			$this->error(sprintf("An error occurred trying to bake: %s in %s", $plugin, $this->path . $plugin));
 		}
 	}
 
@@ -86,13 +86,13 @@ class PluginTask extends BakeTask {
 			$this->findPath($pathOptions);
 		}
 		$this->hr();
-		$this->out(__d('cake_console', "<info>Plugin Name:</info> %s", $plugin));
-		$this->out(__d('cake_console', "<info>Plugin Directory:</info> %s", $this->path . $plugin));
+		$this->out(sprintf("<info>Plugin Name:</info> %s", $plugin));
+		$this->out(sprintf("<info>Plugin Directory:</info> %s", $this->path . $plugin));
 		$this->hr();
 
 		$classBase = 'src';
 
-		$looksGood = $this->in(__d('cake_console', 'Look okay?'), ['y', 'n', 'q'], 'y');
+		$looksGood = $this->in('Look okay?', ['y', 'n', 'q'], 'y');
 
 		if (strtolower($looksGood) === 'y') {
 			$Folder = new Folder($this->path . $plugin);
@@ -146,7 +146,7 @@ class PluginTask extends BakeTask {
 			$this->_generateTestBootstrap($plugin, $this->path);
 
 			$this->hr();
-			$this->out(__d('cake_console', '<success>Created:</success> %s in %s', $plugin, $this->path . $plugin), 2);
+			$this->out(sprintf('<success>Created:</success> %s in %s', $plugin, $this->path . $plugin), 2);
 		}
 
 		return true;
@@ -186,7 +186,7 @@ class PluginTask extends BakeTask {
 		$this->Template->set([
 			'plugin' => $plugin,
 		]);
-		$this->out( __d('cake_console', 'Generating routes.php file...'));
+		$this->out('Generating routes.php file...');
 		$out = $this->Template->generate('config', 'routes');
 		$file = $path . $plugin . DS . 'src' . DS . 'Config' . DS . 'routes.php';
 		$this->createFile($file, $out);
@@ -204,7 +204,7 @@ class PluginTask extends BakeTask {
 			'plugin' => $plugin,
 			'path' => $path
 		]);
-		$this->out( __d('cake_console', 'Generating phpunit.xml file...'));
+		$this->out('Generating phpunit.xml file...');
 		$out = $this->Template->generate('test', 'phpunit.xml');
 		$file = $path . $plugin . DS . 'phpunit.xml';
 		$this->createFile($file, $out);
@@ -223,7 +223,7 @@ class PluginTask extends BakeTask {
 			'path' => $path,
 			'root' => ROOT
 		]);
-		$this->out( __d('cake_console', 'Generating tests/bootstrap.php file...'));
+		$this->out('Generating tests/bootstrap.php file...');
 		$out = $this->Template->generate('test', 'bootstrap');
 		$file = $path . $plugin . DS . 'tests' . DS . 'bootstrap.php';
 		$this->createFile($file, $out);
@@ -249,7 +249,7 @@ class PluginTask extends BakeTask {
 		$config['autoload']['psr-4'][$plugin . '\\'] = "./plugins/$plugin/src";
 		$config['autoload']['psr-4'][$plugin . '\\Test\\'] = "./plugins/$plugin/tests";
 
-		$this->out(__d('cake_console', '<info>Modifying composer autoloader</info>'));
+		$this->out('<info>Modifying composer autoloader</info>');
 
 		file_put_contents(
 			$file,
@@ -259,7 +259,7 @@ class PluginTask extends BakeTask {
 		$composer = $this->Project->findComposer();
 
 		if (!$composer) {
-			$this->error(__d('cake_console', 'Could not locate composer, Add composer to your PATH, or use the -composer option.'));
+			$this->error('Could not locate composer, Add composer to your PATH, or use the -composer option.');
 			return false;
 		}
 
@@ -269,7 +269,7 @@ class PluginTask extends BakeTask {
 			$this->callProcess($command);
 		} catch (\RuntimeException $e) {
 			$error = $e->getMessage();
-			$this->error(__d('cake_console', 'Could not run `composer dump-autoload`: %s', $error));
+			$this->error(sprintf('Could not run `composer dump-autoload`: %s', $error));
 			return false;
 		}
 
@@ -296,7 +296,7 @@ class PluginTask extends BakeTask {
 			foreach ($pathOptions as $i => $option) {
 				$this->out($i + 1 . '. ' . $option);
 			}
-			$prompt = __d('cake_console', 'Choose a plugin path from the paths above.');
+			$prompt = 'Choose a plugin path from the paths above.';
 			$choice = $this->in($prompt, null, 1);
 			if (intval($choice) > 0 && intval($choice) <= $max) {
 				$valid = true;
@@ -312,14 +312,14 @@ class PluginTask extends BakeTask {
  */
 	public function getOptionParser() {
 		$parser = parent::getOptionParser();
-		$parser->description(__d('cake_console',
+		$parser->description(
 			'Create the directory structure, AppController class and testing setup for a new plugin. ' .
 			'Can create plugins in any of your bootstrapped plugin paths.'
-		))->addArgument('name', [
-			'help' => __d('cake_console', 'CamelCased name of the plugin to create.')
+		)->addArgument('name', [
+			'help' => 'CamelCased name of the plugin to create.'
 		])->addOption('composer', [
 			'default' => ROOT . '/composer.phar',
-			'help' => __d('cake_console', 'The path to the composer executable.')
+			'help' => 'The path to the composer executable.'
 		])->removeOption('plugin');
 
 		return $parser;

+ 13 - 13
src/Console/Command/Task/ProjectTask.php

@@ -50,13 +50,13 @@ class ProjectTask extends BakeTask {
 		}
 
 		while (!$project) {
-			$prompt = __d('cake_console', 'What is the path to the project you want to bake?');
+			$prompt = 'What is the path to the project you want to bake?';
 			$project = $this->in($prompt, null, $suggestedPath);
 		}
 
 		$namespace = basename($project);
 		if (!preg_match('/^\w[\w\d_]+$/', $namespace)) {
-			$this->err(__d('cake_console', 'Project Name/Namespace needs to start with a letter and can only contain letters, digits and underscore'));
+			$this->err('Project Name/Namespace needs to start with a letter and can only contain letters, digits and underscore');
 			$this->args = [];
 			return $this->main();
 		}
@@ -67,7 +67,7 @@ class ProjectTask extends BakeTask {
 
 		$response = false;
 		while (!$response && is_dir($project) === true && file_exists($project . 'Config' . 'boostrap.php')) {
-			$prompt = __d('cake_console', '<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
+			$prompt = sprintf('<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
 			$response = $this->in($prompt, ['y', 'n'], 'n');
 			if (strtolower($response) === 'n') {
 				$response = $project = false;
@@ -75,12 +75,12 @@ class ProjectTask extends BakeTask {
 		}
 
 		if ($project === false) {
-			$this->out(__d('cake_console', 'Aborting project creation.'));
+			$this->out('Aborting project creation.');
 			return;
 		}
 
 		if ($this->bake($project)) {
-			$this->out(__d('cake_console', '<success>Project baked successfully!</success>'));
+			$this->out('<success>Project baked successfully!</success>');
 			return $project;
 		}
 	}
@@ -134,10 +134,10 @@ class ProjectTask extends BakeTask {
 	public function bake($path) {
 		$composer = $this->findComposer();
 		if (!$composer) {
-			$this->error(__d('cake_console', 'Cannot bake project. Could not find composer. Add composer to your PATH, or use the -composer option.'));
+			$this->error('Cannot bake project. Could not find composer. Add composer to your PATH, or use the -composer option.');
 			return false;
 		}
-		$this->out(__d('cake_console', '<info>Downloading a new cakephp app from packagist.org</info>'));
+		$this->out('<info>Downloading a new cakephp app from packagist.org</info>');
 
 		$command = 'php ' . escapeshellarg($composer) . ' create-project -s dev cakephp/app ' . escapeshellarg($path);
 
@@ -145,7 +145,7 @@ class ProjectTask extends BakeTask {
 			$this->callProcess($command);
 		} catch (\RuntimeException $e) {
 			$error = $e->getMessage();
-			$this->error(__d('cake_console', 'Installation from packagist.org failed with: %s', $error));
+			$this->error('Installation from packagist.org failed with: %s', $error);
 			return false;
 		}
 
@@ -160,18 +160,18 @@ class ProjectTask extends BakeTask {
 	public function getOptionParser() {
 		$parser = parent::getOptionParser();
 		return $parser->description(
-				__d('cake_console', 'Generate a new CakePHP project skeleton.')
+				'Generate a new CakePHP project skeleton.'
 			)->addArgument('name', [
-				'help' => __d('cake_console', 'Application directory to make, if it starts with "/" the path is absolute.')
+				'help' => 'Application directory to make, if it starts with "/" the path is absolute.'
 			])->addOption('empty', [
 				'boolean' => true,
-				'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git')
+				'help' => 'Create empty files in each of the directories. Good if you are using git'
 			])->addOption('theme', [
 				'short' => 't',
-				'help' => __d('cake_console', 'Theme to use when baking code.')
+				'help' => 'Theme to use when baking code.'
 			])->addOption('composer', [
 				'default' => ROOT . '/composer.phar',
-				'help' => __d('cake_console', 'The path to the composer executable.')
+				'help' => 'The path to the composer executable.'
 			])->removeOption('plugin');
 	}
 

+ 3 - 4
src/Console/Command/Task/SimpleBakeTask.php

@@ -122,17 +122,16 @@ abstract class SimpleBakeTask extends BakeTask {
 		$parser = parent::getOptionParser();
 		$name = $this->name();
 		$parser->description(
-			__d('cake_console', 'Bake a %s class file.', $name)
+			sprintf('Bake a %s class file.', $name)
 		)->addArgument('name', [
-			'help' => __d(
-				'cake_console',
+			'help' => sprintf(
 				'Name of the %s to bake. Can use Plugin.name to bake %s files into plugins.',
 				$name,
 				$name
 			)
 		])->addOption('no-test', [
 			'boolean' => true,
-			'help' => __d('cake_console', 'Do not generate a test skeleton.')
+			'help' => 'Do not generate a test skeleton.'
 		]);
 
 		return $parser;

+ 1 - 1
src/Console/Command/Task/TemplateTask.php

@@ -165,7 +165,7 @@ class TemplateTask extends Shell {
 				return $templatePath;
 			}
 		}
-		$this->err(__d('cake_console', 'Could not find template for %s', $filename));
+		$this->err('Could not find template for %s', $filename);
 		return false;
 	}
 

+ 8 - 8
src/Console/Command/Task/TestTask.php

@@ -108,7 +108,7 @@ class TestTask extends BakeTask {
  */
 	public function outputTypeChoices() {
 		$this->out(
-			__d('cake_console', 'You must provide a class type to bake a test for. The valid types are:'),
+			'You must provide a class type to bake a test for. The valid types are:',
 			2
 		);
 		$i = 0;
@@ -133,7 +133,7 @@ class TestTask extends BakeTask {
 		}
 
 		$this->out(
-			__d('cake_console', 'You must provide a class to bake a test for. Some possible options are:'),
+			'You must provide a class to bake a test for. Some possible options are:',
 			2
 		);
 		$options = $this->_getClassOptions($type);
@@ -180,7 +180,7 @@ class TestTask extends BakeTask {
 			$fixtures = array_map('trim', explode(',', $this->params['fixtures']));
 			$this->_fixtures = array_filter($fixtures);
 		} elseif ($this->typeCanDetectFixtures($type) && class_exists($fullClassName)) {
-			$this->out(__d('cake_console', 'Bake is detecting possible fixtures...'));
+			$this->out('Bake is detecting possible fixtures...');
 			$testSubject = $this->buildTestSubject($type, $fullClassName);
 			$this->generateFixtureList($testSubject);
 		}
@@ -197,7 +197,7 @@ class TestTask extends BakeTask {
 		list($namespace, $className) = namespaceSplit($fullClassName);
 		list($baseNamespace, $subNamespace) = explode('\\', $namespace, 2);
 
-		$this->out("\n" . __d('cake_console', 'Baking test case for %s ...', $fullClassName), 1, Shell::QUIET);
+		$this->out("\n" . sprintf('Baking test case for %s ...', $fullClassName), 1, Shell::QUIET);
 
 		$this->Template->set('fixtures', $this->_fixtures);
 		$this->Template->set('plugin', $this->plugin);
@@ -497,9 +497,9 @@ class TestTask extends BakeTask {
 		$parser = parent::getOptionParser();
 
 		$parser->description(
-			__d('cake_console', 'Bake test case skeletons for classes.')
+			'Bake test case skeletons for classes.'
 		)->addArgument('type', [
-			'help' => __d('cake_console', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'),
+			'help' => 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.',
 			'choices' => [
 				'Controller', 'controller',
 				'Table', 'table',
@@ -509,9 +509,9 @@ class TestTask extends BakeTask {
 				'Behavior', 'behavior'
 			]
 		])->addArgument('name', [
-			'help' => __d('cake_console', 'An existing class to bake tests for.')
+			'help' => 'An existing class to bake tests for.'
 		])->addOption('fixtures', [
-			'help' => __d('cake_console', 'A comma separated list of fixture names you want to include.')
+			'help' => 'A comma separated list of fixture names you want to include.'
 		]);
 
 		return $parser;

+ 17 - 17
src/Console/Command/Task/ViewTask.php

@@ -105,7 +105,7 @@ class ViewTask extends BakeTask {
 		parent::main();
 
 		if (empty($name)) {
-			$this->out(__d('cake_console', 'Possible tables to bake views for based on your current database:'));
+			$this->out('Possible tables to bake views for based on your current database:');
 			$this->Model->connection = $this->connection;
 			foreach ($this->Model->listAll() as $table) {
 				$this->out('- ' . $this->_controllerName($table));
@@ -303,25 +303,25 @@ class ViewTask extends BakeTask {
 	public function customAction() {
 		$action = '';
 		while (!$action) {
-			$action = $this->in(__d('cake_console', 'Action Name? (use lowercase_underscored function name)'));
+			$action = $this->in('Action Name? (use lowercase_underscored function name)');
 			if (!$action) {
-				$this->out(__d('cake_console', 'The action name you supplied was empty. Please try again.'));
+				$this->out('The action name you supplied was empty. Please try again.');
 			}
 		}
 		$this->out();
 		$this->hr();
-		$this->out(__d('cake_console', 'The following view will be created:'));
+		$this->out('The following view will be created:');
 		$this->hr();
-		$this->out(__d('cake_console', 'Controller Name: %s', $this->controllerName));
-		$this->out(__d('cake_console', 'Action Name:     %s', $action));
-		$this->out(__d('cake_console', 'Path:            %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
+		$this->out(sprintf('Controller Name: %s', $this->controllerName));
+		$this->out(sprintf('Action Name:     %s', $action));
+		$this->out(sprintf('Path:            %s', $this->getPath() . $this->controllerName . DS . Inflector::underscore($action) . ".ctp"));
 		$this->hr();
-		$looksGood = $this->in(__d('cake_console', 'Look okay?'), ['y', 'n'], 'y');
+		$looksGood = $this->in('Look okay?', ['y', 'n'], 'y');
 		if (strtolower($looksGood) === 'y') {
 			$this->bake($action, ' ');
 			return $this->_stop();
 		}
-		$this->out(__d('cake_console', 'Bake Aborted.'));
+		$this->out('Bake Aborted.');
 	}
 
 /**
@@ -338,7 +338,7 @@ class ViewTask extends BakeTask {
 		if (empty($content)) {
 			return false;
 		}
-		$this->out("\n" . __d('cake_console', 'Baking `%s` view file...', $action), 1, Shell::QUIET);
+		$this->out("\n" . sprintf('Baking `%s` view file...', $action), 1, Shell::QUIET);
 		$path = $this->getPath();
 		$filename = $path . Inflector::underscore($action) . '.ctp';
 		$this->createFile($filename, $content);
@@ -410,19 +410,19 @@ class ViewTask extends BakeTask {
 		$parser = parent::getOptionParser();
 
 		$parser->description(
-			__d('cake_console', 'Bake views for a controller, using built-in or custom templates. ')
+			'Bake views for a controller, using built-in or custom templates. '
 		)->addArgument('controller', [
-			'help' => __d('cake_console', 'Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.')
+			'help' => 'Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.'
 		])->addArgument('action', [
-			'help' => __d('cake_console', "Will bake a single action's file. core templates are (index, add, edit, view)")
+			'help' => "Will bake a single action's file. core templates are (index, add, edit, view)"
 		])->addArgument('alias', [
-			'help' => __d('cake_console', 'Will bake the template in <action> but create the filename after <alias>.')
+			'help' => 'Will bake the template in <action> but create the filename after <alias>.'
 		])->addOption('controller', [
-			'help' => __d('cake_console', 'The controller name if you have a controller that does not follow conventions.')
+			'help' => 'The controller name if you have a controller that does not follow conventions.'
 		])->addOption('prefix', [
-			'help' => __d('cake_console', 'The routing prefix to generate views for.'),
+			'help' => 'The routing prefix to generate views for.',
 		])->addSubcommand('all', [
-			'help' => __d('cake_console', 'Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
+			'help' => 'Bake all CRUD action views for all controllers. Requires models and controllers to exist.'
 		]);
 
 		return $parser;

+ 4 - 4
src/Console/ConsoleErrorHandler.php

@@ -74,9 +74,9 @@ class ConsoleErrorHandler extends BaseErrorHandler {
  * @return void
  */
 	protected function _displayException($exception) {
-		$errorName = __d('cake_console', 'Exception:');
+		$errorName = 'Exception:';
 		if ($exception instanceof FatalErrorException) {
-			$errorName = __d('cake_console', 'Fatal Error:');
+			$errorName = 'Fatal Error:';
 		}
 		$message = sprintf(
 			"<error>%s</error> %s in [%s, line %s]",
@@ -98,12 +98,12 @@ class ConsoleErrorHandler extends BaseErrorHandler {
  * @return void
  */
 	protected function _displayError($error, $debug) {
-		$message = __d('cake_console', '%s in [%s, line %s]',
+		$message = sprintf('%s in [%s, line %s]',
 			$error['description'],
 			$error['file'],
 			$error['line']
 		);
-		$message = __d('cake_console', "<error>%s Error:</error> %s\n",
+		$message = sprintf("<error>%s Error:</error> %s\n",
 			$error['error'],
 			$message
 		);

+ 3 - 3
src/Console/ConsoleInputArgument.php

@@ -93,10 +93,10 @@ class ConsoleInputArgument {
 		}
 		$optional = '';
 		if (!$this->isRequired()) {
-			$optional = __d('cake_console', ' <comment>(optional)</comment>');
+			$optional = ' <comment>(optional)</comment>';
 		}
 		if (!empty($this->_choices)) {
-			$optional .= __d('cake_console', ' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
+			$optional .= sprintf(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
 		}
 		return sprintf('%s%s%s', $name, $this->_help, $optional);
 	}
@@ -140,7 +140,7 @@ class ConsoleInputArgument {
 		}
 		if (!in_array($value, $this->_choices)) {
 			throw new Error\ConsoleException(
-				__d('cake_console', '"%s" is not a valid value for %s. Please use one of "%s"',
+				sprintf('"%s" is not a valid value for %s. Please use one of "%s"',
 				$value, $this->_name, implode(', ', $this->_choices)
 			));
 		}

+ 4 - 4
src/Console/ConsoleInputOption.php

@@ -90,7 +90,7 @@ class ConsoleInputOption {
 		}
 		if (strlen($this->_short) > 1) {
 			throw new Error\ConsoleException(
-				__d('cake_console', 'Short option "%s" is invalid, short options must be one letter.', $this->_short)
+				sprintf('Short option "%s" is invalid, short options must be one letter.', $this->_short)
 			);
 		}
 	}
@@ -122,10 +122,10 @@ class ConsoleInputOption {
 	public function help($width = 0) {
 		$default = $short = '';
 		if (!empty($this->_default) && $this->_default !== true) {
-			$default = __d('cake_console', ' <comment>(default: %s)</comment>', $this->_default);
+			$default = sprintf(' <comment>(default: %s)</comment>', $this->_default);
 		}
 		if (!empty($this->_choices)) {
-			$default .= __d('cake_console', ' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
+			$default .= sprintf(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
 		}
 		if (!empty($this->_short)) {
 			$short = ', -' . $this->_short;
@@ -185,7 +185,7 @@ class ConsoleInputOption {
 		}
 		if (!in_array($value, $this->_choices)) {
 			throw new Error\ConsoleException(
-				__d('cake_console', '"%s" is not a valid value for --%s. Please use one of "%s"',
+				sprintf('"%s" is not a valid value for --%s. Please use one of "%s"',
 				$value, $this->_name, implode(', ', $this->_choices)
 			));
 		}

+ 7 - 7
src/Console/ConsoleOptionParser.php

@@ -135,18 +135,18 @@ class ConsoleOptionParser {
 
 		$this->addOption('help', [
 			'short' => 'h',
-			'help' => __d('cake_console', 'Display this help.'),
+			'help' => 'Display this help.',
 			'boolean' => true
 		]);
 
 		if ($defaultOptions) {
 			$this->addOption('verbose', [
 				'short' => 'v',
-				'help' => __d('cake_console', 'Enable verbose output.'),
+				'help' => 'Enable verbose output.',
 				'boolean' => true
 			])->addOption('quiet', [
 				'short' => 'q',
-				'help' => __d('cake_console', 'Enable quiet output.'),
+				'help' => 'Enable quiet output.',
 				'boolean' => true
 			]);
 		}
@@ -485,7 +485,7 @@ class ConsoleOptionParser {
 		foreach ($this->_args as $i => $arg) {
 			if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) {
 				throw new Error\ConsoleException(
-					__d('cake_console', 'Missing required arguments. %s is required.', $arg->name())
+					sprintf('Missing required arguments. %s is required.', $arg->name())
 				);
 			}
 		}
@@ -569,7 +569,7 @@ class ConsoleOptionParser {
 			}
 		}
 		if (!isset($this->_shortOptions[$key])) {
-			throw new Error\ConsoleException(__d('cake_console', 'Unknown short option `%s`', $key));
+			throw new Error\ConsoleException(sprintf('Unknown short option `%s`', $key));
 		}
 		$name = $this->_shortOptions[$key];
 		return $this->_parseOption($name, $params);
@@ -585,7 +585,7 @@ class ConsoleOptionParser {
  */
 	protected function _parseOption($name, $params) {
 		if (!isset($this->_options[$name])) {
-			throw new Error\ConsoleException(__d('cake_console', 'Unknown option `%s`', $name));
+			throw new Error\ConsoleException(sprintf('Unknown option `%s`', $name));
 		}
 		$option = $this->_options[$name];
 		$isBoolean = $option->isBoolean();
@@ -638,7 +638,7 @@ class ConsoleOptionParser {
 		}
 		$next = count($args);
 		if (!isset($this->_args[$next])) {
-			throw new Error\ConsoleException(__d('cake_console', 'Too many arguments.'));
+			throw new Error\ConsoleException('Too many arguments.');
 		}
 
 		if ($this->_args[$next]->validChoice($argument)) {

+ 5 - 5
src/Console/HelpFormatter.php

@@ -64,12 +64,12 @@ class HelpFormatter {
 			$out[] = String::wrap($description, $width);
 			$out[] = '';
 		}
-		$out[] = __d('cake_console', '<info>Usage:</info>');
+		$out[] = '<info>Usage:</info>';
 		$out[] = $this->_generateUsage();
 		$out[] = '';
 		$subcommands = $parser->subcommands();
 		if (!empty($subcommands)) {
-			$out[] = __d('cake_console', '<info>Subcommands:</info>');
+			$out[] = '<info>Subcommands:</info>';
 			$out[] = '';
 			$max = $this->_getMaxLength($subcommands) + 2;
 			foreach ($subcommands as $command) {
@@ -80,14 +80,14 @@ class HelpFormatter {
 				]);
 			}
 			$out[] = '';
-			$out[] = __d('cake_console', 'To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>', $parser->command());
+			$out[] = sprintf('To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>', $parser->command());
 			$out[] = '';
 		}
 
 		$options = $parser->options();
 		if (!empty($options)) {
 			$max = $this->_getMaxLength($options) + 8;
-			$out[] = __d('cake_console', '<info>Options:</info>');
+			$out[] = '<info>Options:</info>';
 			$out[] = '';
 			foreach ($options as $option) {
 				$out[] = String::wrap($option->help($max), [
@@ -102,7 +102,7 @@ class HelpFormatter {
 		$arguments = $parser->arguments();
 		if (!empty($arguments)) {
 			$max = $this->_getMaxLength($arguments) + 2;
-			$out[] = __d('cake_console', '<info>Arguments:</info>');
+			$out[] = '<info>Arguments:</info>';
 			$out[] = '';
 			foreach ($arguments as $argument) {
 				$out[] = String::wrap($argument->help($max), [

+ 11 - 11
src/Console/Shell.php

@@ -215,10 +215,10 @@ class Shell {
  */
 	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(sprintf('App : %s', APP_DIR));
+		$this->out(sprintf('Path: %s', APP));
 		$this->hr();
 	}
 
@@ -533,7 +533,7 @@ class Shell {
  * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::error
  */
 	public function error($title, $message = null) {
-		$this->_io->err(__d('cake_console', '<error>Error:</error> %s', $title));
+		$this->_io->err(sprintf('<error>Error:</error> %s', $title));
 
 		if (!empty($message)) {
 			$this->_io->err($message);
@@ -571,29 +571,29 @@ class Shell {
 		$this->_io->out();
 
 		if (is_file($path) && empty($this->params['force'])) {
-			$this->_io->out(__d('cake_console', '<warning>File `%s` exists</warning>', $path));
-			$key = $this->_io->askChoice(__d('cake_console', 'Do you want to overwrite?'), ['y', 'n', 'q'], 'n');
+			$this->_io->out(sprintf('<warning>File `%s` exists</warning>', $path));
+			$key = $this->_io->askChoice('Do you want to overwrite?', ['y', 'n', 'q'], 'n');
 
 			if (strtolower($key) === 'q') {
-				$this->_io->out(__d('cake_console', '<error>Quitting</error>.'), 2);
+				$this->_io->out('<error>Quitting</error>.', 2);
 				return $this->_stop();
 			} elseif (strtolower($key) !== 'y') {
-				$this->_io->out(__d('cake_console', 'Skip `%s`', $path), 2);
+				$this->_io->out(sprintf('Skip `%s`', $path), 2);
 				return false;
 			}
 		} else {
-			$this->out(__d('cake_console', 'Creating file %s', $path));
+			$this->out(sprintf('Creating file %s', $path));
 		}
 
 		$File = new File($path, true);
 		if ($File->exists() && $File->writable()) {
 			$data = $File->prepare($contents);
 			$File->write($data);
-			$this->_io->out(__d('cake_console', '<success>Wrote</success> `%s`', $path));
+			$this->_io->out(sprintf('<success>Wrote</success> `%s`', $path));
 			return true;
 		}
 
-		$this->_io->err(__d('cake_console', '<error>Could not write to `%s`</error>.', $path), 2);
+		$this->_io->err(sprintf('<error>Could not write to `%s`</error>.', $path), 2);
 		return false;
 	}