Replaced the *printf with i18n aliases by i18n aliases with params.

This commit is contained in:
Juan Basso 2010-12-04 23:37:13 -02:00
parent 30661ed154
commit c52d5320c8
78 changed files with 239 additions and 240 deletions

View file

@ -75,8 +75,8 @@ class ConsoleErrorHandler extends ErrorHandler {
} }
$stderr = self::getStderr(); $stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code); list($name, $log) = self::_mapErrorCode($code);
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line); $message = __('%s in [%s, line %s]', $description, $file, $line);
$stderr->write(sprintf(__("<error>%s Error:</error> %s\n"), $name, $message)); $stderr->write(__("<error>%s Error:</error> %s\n", $name, $message));
if (Configure::read('debug') == 0) { if (Configure::read('debug') == 0) {
App::import('Core', 'CakeLog'); App::import('Core', 'CakeLog');

View file

@ -75,7 +75,7 @@ class ConsoleInputArgument {
$optional = __(' <comment>(optional)</comment>'); $optional = __(' <comment>(optional)</comment>');
} }
if (!empty($this->_choices)) { if (!empty($this->_choices)) {
$optional .= sprintf(__(' <comment>(choices: %s)</comment>'), implode('|', $this->_choices)); $optional .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
} }
return sprintf('%s%s%s', $name, $this->_help, $optional); return sprintf('%s%s%s', $name, $this->_help, $optional);
} }

View file

@ -82,10 +82,10 @@ class ConsoleInputOption {
public function help($width = 0) { public function help($width = 0) {
$default = $short = ''; $default = $short = '';
if (!empty($this->_default) && $this->_default !== true) { if (!empty($this->_default) && $this->_default !== true) {
$default = sprintf(__(' <comment>(default: %s)</comment>'), $this->_default); $default = __(' <comment>(default: %s)</comment>', $this->_default);
} }
if (!empty($this->_choices)) { if (!empty($this->_choices)) {
$default .= sprintf(__(' <comment>(choices: %s)</comment>'), implode('|', $this->_choices)); $default .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
} }
if (!empty($this->_short)) { if (!empty($this->_short)) {
$short = ', -' . $this->_short; $short = ', -' . $this->_short;

View file

@ -458,7 +458,7 @@ class ConsoleOptionParser {
foreach ($this->_args as $i => $arg) { foreach ($this->_args as $i => $arg) {
if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) { if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) {
throw new RuntimeException( throw new RuntimeException(
sprintf(__('Missing required arguments. %s is required.'), $arg->name()) __('Missing required arguments. %s is required.', $arg->name())
); );
} }
} }
@ -552,7 +552,7 @@ class ConsoleOptionParser {
*/ */
protected function _parseOption($name, $params) { protected function _parseOption($name, $params) {
if (!isset($this->_options[$name])) { if (!isset($this->_options[$name])) {
throw new InvalidArgumentException(sprintf(__('Unknown option `%s`'), $name)); throw new InvalidArgumentException(__('Unknown option `%s`', $name));
} }
$option = $this->_options[$name]; $option = $this->_options[$name];
$isBoolean = $option->isBoolean(); $isBoolean = $option->isBoolean();

View file

@ -78,7 +78,7 @@ class AclShell extends Shell {
$out .= __('your core config to reflect your decision to use') . "\n"; $out .= __('your core config to reflect your decision to use') . "\n";
$out .= __('DbAcl before attempting to use this script') . ".\n"; $out .= __('DbAcl before attempting to use this script') . ".\n";
$out .= "--------------------------------------------------\n"; $out .= "--------------------------------------------------\n";
$out .= sprintf(__('Current ACL Classname: %s'), Configure::read('Acl.classname')) . "\n"; $out .= __('Current ACL Classname: %s', Configure::read('Acl.classname')) . "\n";
$out .= "--------------------------------------------------\n"; $out .= "--------------------------------------------------\n";
$this->err($out); $this->err($out);
$this->_stop(); $this->_stop();
@ -135,9 +135,9 @@ class AclShell extends Shell {
$data['parent_id'] = $parent; $data['parent_id'] = $parent;
$this->Acl->{$class}->create(); $this->Acl->{$class}->create();
if ($this->Acl->{$class}->save($data)) { if ($this->Acl->{$class}->save($data)) {
$this->out(sprintf(__("<success>New %s</success> '%s' created."), $class, $this->args[2]), 2); $this->out(__("<success>New %s</success> '%s' created.", $class, $this->args[2]), 2);
} else { } else {
$this->err(sprintf(__("There was a problem creating a new %s '%s'."), $class, $this->args[2])); $this->err(__("There was a problem creating a new %s '%s'.", $class, $this->args[2]));
} }
} }
@ -152,9 +152,9 @@ class AclShell extends Shell {
$nodeId = $this->_getNodeId($class, $identifier); $nodeId = $this->_getNodeId($class, $identifier);
if (!$this->Acl->{$class}->delete($nodeId)) { if (!$this->Acl->{$class}->delete($nodeId)) {
$this->error(__('Node Not Deleted') . sprintf(__('There was an error deleting the %s. Check that the node exists'), $class) . ".\n"); $this->error(__('Node Not Deleted') . __('There was an error deleting the %s. Check that the node exists', $class) . ".\n");
} }
$this->out(sprintf(__('<success>%s deleted.</success>'), $class), 2); $this->out(__('<success>%s deleted.</success>', $class), 2);
} }
/** /**
@ -176,7 +176,7 @@ class AclShell extends Shell {
if (!$this->Acl->{$class}->save($data)) { if (!$this->Acl->{$class}->save($data)) {
$this->out(__('Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.'), true); $this->out(__('Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.'), true);
} else { } else {
$this->out(sprintf(__('Node parent set to %s'), $this->args[2]) . "\n", true); $this->out(__('Node parent set to %s', $this->args[2]) . "\n", true);
} }
} }
@ -193,7 +193,7 @@ class AclShell extends Shell {
if (empty($nodes)) { if (empty($nodes)) {
$this->error( $this->error(
sprintf(__("Supplied Node '%s' not found"), $this->args[1]), __("Supplied Node '%s' not found", $this->args[1]),
__('No tree returned.') __('No tree returned.')
); );
} }
@ -230,9 +230,9 @@ class AclShell extends Shell {
extract($this->__getParams()); extract($this->__getParams());
if ($this->Acl->check($aro, $aco, $action)) { if ($this->Acl->check($aro, $aco, $action)) {
$this->out(sprintf(__('%s is <success>allowed</success>.'), $aroName), true); $this->out(__('%s is <success>allowed</success>.', $aroName), true);
} else { } else {
$this->out(sprintf(__('%s is <error>not allowed</error>.'), $aroName), true); $this->out(__('%s is <error>not allowed</error>.', $aroName), true);
} }
} }
@ -305,9 +305,9 @@ class AclShell extends Shell {
if (empty($nodes)) { if (empty($nodes)) {
if (isset($this->args[1])) { if (isset($this->args[1])) {
$this->error(sprintf(__('%s not found'), $this->args[1]), __('No tree returned.')); $this->error(__('%s not found', $this->args[1]), __('No tree returned.'));
} elseif (isset($this->args[0])) { } elseif (isset($this->args[0])) {
$this->error(sprintf(__('%s not found'), $this->args[0]), __('No tree returned.')); $this->error(__('%s not found', $this->args[0]), __('No tree returned.'));
} }
} }
$this->out($class . " tree:"); $this->out($class . " tree:");
@ -522,7 +522,7 @@ class AclShell extends Shell {
$conditions = array($class . '.' . $key => $this->args[1]); $conditions = array($class . '.' . $key => $this->args[1]);
$possibility = $this->Acl->{$class}->find('all', compact('conditions')); $possibility = $this->Acl->{$class}->find('all', compact('conditions'));
if (empty($possibility)) { if (empty($possibility)) {
$this->error(sprintf(__('%s not found'), $this->args[1]), __('No tree returned.')); $this->error(__('%s not found', $this->args[1]), __('No tree returned.'));
} }
return $possibility; return $possibility;
} }
@ -558,7 +558,7 @@ class AclShell extends Shell {
if (is_array($identifier)) { if (is_array($identifier)) {
$identifier = var_export($identifier, true); $identifier = var_export($identifier, true);
} }
$this->error(sprintf(__('Could not find node using reference "%s"'), $identifier)); $this->error(__('Could not find node using reference "%s"', $identifier));
} }
return Set::extract($node, "0.{$class}.id"); return Set::extract($node, "0.{$class}.id");
} }

View file

@ -87,7 +87,7 @@ class ApiShell extends Shell {
} }
} else { } else {
$this->error(sprintf(__('%s not found'), $class)); $this->error(__('%s not found', $class));
} }
$parsed = $this->__parseClass($path . $file .'.php', $class); $parsed = $this->__parseClass($path . $file .'.php', $class);
@ -95,7 +95,7 @@ class ApiShell extends Shell {
if (!empty($parsed)) { if (!empty($parsed)) {
if (isset($this->params['method'])) { if (isset($this->params['method'])) {
if (!isset($parsed[$this->params['method']])) { if (!isset($parsed[$this->params['method']])) {
$this->err(sprintf(__('%s::%s() could not be found'), $class, $this->params['method'])); $this->err(__('%s::%s() could not be found', $class, $this->params['method']));
$this->_stop(); $this->_stop();
} }
$method = $parsed[$this->params['method']]; $method = $parsed[$this->params['method']];
@ -200,7 +200,7 @@ class ApiShell extends Shell {
$parsed = array(); $parsed = array();
if (!include_once($path)) { if (!include_once($path)) {
$this->err(sprintf(__('%s could not be found'), $path)); $this->err(__('%s could not be found', $path));
} }
$reflection = new ReflectionClass($class); $reflection = new ReflectionClass($class);

View file

@ -114,7 +114,7 @@ class SchemaShell extends Shell {
$this->_stop(); $this->_stop();
} else { } else {
$file = $this->Schema->path . DS . $this->params['file']; $file = $this->Schema->path . DS . $this->params['file'];
$this->err(sprintf(__('Schema file (%s) could not be found.'), $file)); $this->err(__('Schema file (%s) could not be found.', $file));
$this->_stop(); $this->_stop();
} }
} }
@ -179,7 +179,7 @@ class SchemaShell extends Shell {
} }
if ($this->Schema->write($content)) { if ($this->Schema->write($content)) {
$this->out(sprintf(__('Schema file: %s generated'), $content['file'])); $this->out(__('Schema file: %s generated', $content['file']));
$this->_stop(); $this->_stop();
} else { } else {
$this->err(__('Schema file: %s generated')); $this->err(__('Schema file: %s generated'));
@ -224,7 +224,7 @@ class SchemaShell extends Shell {
} }
if ($File->write($contents)) { if ($File->write($contents)) {
$this->out(sprintf(__('SQL dump file created in %s'), $File->pwd())); $this->out(__('SQL dump file created in %s', $File->pwd()));
$this->_stop(); $this->_stop();
} else { } else {
$this->err(__('SQL dump could not be created')); $this->err(__('SQL dump could not be created'));
@ -283,7 +283,7 @@ class SchemaShell extends Shell {
$Schema = $this->Schema->load($options); $Schema = $this->Schema->load($options);
if (!$Schema) { if (!$Schema) {
$this->err(sprintf(__('%s could not be loaded'), $this->Schema->path . DS . $this->Schema->file)); $this->err(__('%s could not be loaded', $this->Schema->path . DS . $this->Schema->file));
$this->_stop(); $this->_stop();
} }
$table = null; $table = null;
@ -394,10 +394,10 @@ class SchemaShell extends Shell {
foreach ($contents as $table => $sql) { foreach ($contents as $table => $sql) {
if (empty($sql)) { if (empty($sql)) {
$this->out(sprintf(__('%s is up to date.'), $table)); $this->out(__('%s is up to date.', $table));
} else { } else {
if ($this->__dry === true) { if ($this->__dry === true) {
$this->out(sprintf(__('Dry run for %s :'), $table)); $this->out(__('Dry run for %s :', $table));
$this->out($sql); $this->out($sql);
} else { } else {
if (!$Schema->before(array($event => $table))) { if (!$Schema->before(array($event => $table))) {
@ -413,7 +413,7 @@ class SchemaShell extends Shell {
if (!empty($error)) { if (!empty($error)) {
$this->out($error); $this->out($error);
} else { } else {
$this->out(sprintf(__('%s updated.'), $table)); $this->out(__('%s updated.', $table));
} }
} }
} }

View file

@ -558,7 +558,7 @@ class Shell extends Object {
* @param string $message An optional error message * @param string $message An optional error message
*/ */
public function error($title, $message = null) { public function error($title, $message = null) {
$this->err(sprintf(__('<error>Error:</error> %s'), $title)); $this->err(__('<error>Error:</error> %s', $title));
if (!empty($message)) { if (!empty($message)) {
$this->err($message); $this->err($message);
@ -594,18 +594,18 @@ class Shell extends Object {
$this->out(); $this->out();
if (is_file($path) && $this->interactive === true) { if (is_file($path) && $this->interactive === true) {
$this->out(sprintf(__('<warning>File `%s` exists</warning>'), $path)); $this->out(__('<warning>File `%s` exists</warning>', $path));
$key = $this->in(__('Do you want to overwrite?'), array('y', 'n', 'q'), 'n'); $key = $this->in(__('Do you want to overwrite?'), array('y', 'n', 'q'), 'n');
if (strtolower($key) == 'q') { if (strtolower($key) == 'q') {
$this->out(__('<error>Quitting</error>.'), 2); $this->out(__('<error>Quitting</error>.'), 2);
$this->_stop(); $this->_stop();
} elseif (strtolower($key) != 'y') { } elseif (strtolower($key) != 'y') {
$this->out(sprintf(__('Skip `%s`'), $path), 2); $this->out(__('Skip `%s`', $path), 2);
return false; return false;
} }
} else { } else {
$this->out(sprintf(__('Creating file %s'), $path)); $this->out(__('Creating file %s', $path));
} }
if (!class_exists('File')) { if (!class_exists('File')) {
@ -615,10 +615,10 @@ class Shell extends Object {
if ($File = new File($path, true)) { if ($File = new File($path, true)) {
$data = $File->prepare($contents); $data = $File->prepare($contents);
$File->write($data); $File->write($data);
$this->out(sprintf(__('<success>Wrote</success> `%s`'), $path)); $this->out(__('<success>Wrote</success> `%s`', $path));
return true; return true;
} else { } else {
$this->err(sprintf(__('<error>Could not write to `%s`</error>.'), $path), 2); $this->err(__('<error>Could not write to `%s`</error>.', $path), 2);
return false; return false;
} }
} }

View file

@ -79,7 +79,7 @@ class ControllerTask extends BakeTask {
if (!empty($this->params['admin'])) { if (!empty($this->params['admin'])) {
$admin = $this->Project->getPrefix(); $admin = $this->Project->getPrefix();
if ($admin) { if ($admin) {
$this->out(sprintf(__('Adding %s methods'), $admin)); $this->out(__('Adding %s methods', $admin));
$actions .= "\n" . $this->bakeActions($controller, $admin); $actions .= "\n" . $this->bakeActions($controller, $admin);
} }
} }
@ -125,7 +125,7 @@ class ControllerTask extends BakeTask {
protected function _interactive() { protected function _interactive() {
$this->interactive = true; $this->interactive = true;
$this->hr(); $this->hr();
$this->out(sprintf(__("Bake Controller\nPath: %s"), $this->path)); $this->out(__("Bake Controller\nPath: %s", $this->path));
$this->hr(); $this->hr();
if (empty($this->connection)) { if (empty($this->connection)) {
@ -134,7 +134,7 @@ class ControllerTask extends BakeTask {
$controllerName = $this->getName(); $controllerName = $this->getName();
$this->hr(); $this->hr();
$this->out(sprintf(__('Baking %sController'), $controllerName)); $this->out(__('Baking %sController', $controllerName));
$this->hr(); $this->hr();
$helpers = $components = array(); $helpers = $components = array();
@ -148,7 +148,7 @@ class ControllerTask extends BakeTask {
$question[] = __("Would you like to build your controller interactively?"); $question[] = __("Would you like to build your controller interactively?");
if (file_exists($this->path . $controllerFile .'_controller.php')) { if (file_exists($this->path . $controllerFile .'_controller.php')) {
$question[] = sprintf(__("Warning: Choosing no will overwrite the %sController."), $controllerName); $question[] = __("Warning: Choosing no will overwrite the %sController.", $controllerName);
} }
$doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y'); $doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y');
@ -213,7 +213,7 @@ class ControllerTask extends BakeTask {
$this->hr(); $this->hr();
$this->out(__('The following controller will be created:')); $this->out(__('The following controller will be created:'));
$this->hr(); $this->hr();
$this->out(sprintf(__("Controller Name:\n\t%s"), $controllerName)); $this->out(__("Controller Name:\n\t%s", $controllerName));
if (strtolower($useDynamicScaffold) == 'y') { if (strtolower($useDynamicScaffold) == 'y') {
$this->out("var \$scaffold;"); $this->out("var \$scaffold;");

View file

@ -114,7 +114,7 @@ class ExtractTask extends Shell {
$this->__paths = explode(',', $this->params['paths']); $this->__paths = explode(',', $this->params['paths']);
} else { } else {
$defaultPath = APP_PATH; $defaultPath = APP_PATH;
$message = sprintf(__("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one"), $this->Dispatch->params['root'] . DS . 'myapp'); $message = __("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", $this->Dispatch->params['root'] . DS . 'myapp');
while (true) { while (true) {
$response = $this->in($message, null, $defaultPath); $response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') { if (strtoupper($response) === 'Q') {
@ -136,7 +136,7 @@ class ExtractTask extends Shell {
if (isset($this->params['output'])) { if (isset($this->params['output'])) {
$this->__output = $this->params['output']; $this->__output = $this->params['output'];
} else { } else {
$message = sprintf(__("What is the full path you would like to output?\nExample: %s\n[Q]uit"), $this->__paths[0] . DS . 'locale'); $message = __("What is the full path you would like to output?\nExample: %s\n[Q]uit", $this->__paths[0] . DS . 'locale');
while (true) { while (true) {
$response = $this->in($message, null, $this->__paths[0] . DS . 'locale'); $response = $this->in($message, null, $this->__paths[0] . DS . 'locale');
if (strtoupper($response) === 'Q') { if (strtoupper($response) === 'Q') {
@ -156,7 +156,7 @@ class ExtractTask extends Shell {
$this->__merge = !(strtolower($this->params['merge']) === 'no'); $this->__merge = !(strtolower($this->params['merge']) === 'no');
} else { } else {
$this->out(); $this->out();
$response = $this->in(sprintf(__('Would you like to merge all domains strings into the default.pot file?')), array('y', 'n'), 'n'); $response = $this->in(__('Would you like to merge all domains strings into the default.pot file?'), array('y', 'n'), 'n');
$this->__merge = strtolower($response) === 'y'; $this->__merge = strtolower($response) === 'y';
} }
@ -250,7 +250,7 @@ class ExtractTask extends Shell {
function __extractTokens() { function __extractTokens() {
foreach ($this->__files as $file) { foreach ($this->__files as $file) {
$this->__file = $file; $this->__file = $file;
$this->out(sprintf(__('Processing %s...'), $file)); $this->out(__('Processing %s...', $file));
$code = file_get_contents($file); $code = file_get_contents($file);
$allTokens = token_get_all($code); $allTokens = token_get_all($code);
@ -413,11 +413,11 @@ class ExtractTask extends Shell {
$response = ''; $response = '';
while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') { while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') {
$this->out(); $this->out();
$response = $this->in(sprintf(__('Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll'), $filename), array('y', 'n', 'a'), 'y'); $response = $this->in(__('Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', $filename), array('y', 'n', 'a'), 'y');
if (strtoupper($response) === 'N') { if (strtoupper($response) === 'N') {
$response = ''; $response = '';
while ($response == '') { while ($response == '') {
$response = $this->in(sprintf(__("What would you like to name this file?\nExample: %s"), 'new_' . $filename), null, 'new_' . $filename); $response = $this->in(__("What would you like to name this file?\nExample: %s", 'new_' . $filename), null, 'new_' . $filename);
$File = new File($this->__output . $response); $File = new File($this->__output . $response);
$filename = $response; $filename = $response;
} }
@ -485,7 +485,7 @@ class ExtractTask extends Shell {
* @access private * @access private
*/ */
function __markerError($file, $line, $marker, $count) { function __markerError($file, $line, $marker, $count) {
$this->out(sprintf(__("Invalid marker content in %s:%s\n* %s("), $file, $line, $marker), true); $this->out(__("Invalid marker content in %s:%s\n* %s(", $file, $line, $marker), true);
$count += 2; $count += 2;
$tokenCount = count($this->__tokens); $tokenCount = count($this->__tokens);
$parenthesis = 1; $parenthesis = 1;

View file

@ -166,7 +166,7 @@ class FixtureTask extends BakeTask {
$options['records'] = true; $options['records'] = true;
} }
if ($doRecords == 'n') { if ($doRecords == 'n') {
$prompt = sprintf(__("Would you like to build this fixture with data from %s's table?"), $modelName); $prompt = __("Would you like to build this fixture with data from %s's table?", $modelName);
$fromTable = $this->in($prompt, array('y', 'n'), 'n'); $fromTable = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($fromTable) == 'y') { if (strtolower($fromTable) == 'y') {
$options['fromTable'] = true; $options['fromTable'] = true;

View file

@ -112,7 +112,7 @@ class ModelTask extends BakeTask {
continue; continue;
} }
$modelClass = Inflector::classify($table); $modelClass = Inflector::classify($table);
$this->out(sprintf(__('Baking %s'), $modelClass)); $this->out(__('Baking %s', $modelClass));
$object = $this->_getModelObject($modelClass); $object = $this->_getModelObject($modelClass);
if ($this->bake($object, false) && $unitTestExists) { if ($this->bake($object, false) && $unitTestExists) {
$this->bakeFixture($modelClass); $this->bakeFixture($modelClass);
@ -190,7 +190,7 @@ class ModelTask extends BakeTask {
$primaryKey = $this->findPrimaryKey($fields); $primaryKey = $this->findPrimaryKey($fields);
} }
} else { } else {
$this->err(sprintf(__('Table %s does not exist, cannot bake a model without a table.'), $useTable)); $this->err(__('Table %s does not exist, cannot bake a model without a table.', $useTable));
$this->_stop(); $this->_stop();
return false; return false;
} }
@ -218,16 +218,16 @@ class ModelTask extends BakeTask {
$this->out("Name: " . $currentModelName); $this->out("Name: " . $currentModelName);
if ($this->connection !== 'default') { if ($this->connection !== 'default') {
$this->out(sprintf(__("DB Config: %s"), $this->connection)); $this->out(__("DB Config: %s", $this->connection));
} }
if ($fullTableName !== Inflector::tableize($currentModelName)) { if ($fullTableName !== Inflector::tableize($currentModelName)) {
$this->out(sprintf(__('DB Table: %s'), $fullTableName)); $this->out(__('DB Table: %s', $fullTableName));
} }
if ($primaryKey != 'id') { if ($primaryKey != 'id') {
$this->out(sprintf(__('Primary Key: %s'), $primaryKey)); $this->out(__('Primary Key: %s', $primaryKey));
} }
if (!empty($validate)) { if (!empty($validate)) {
$this->out(sprintf(__('Validation: %s'), print_r($validate, true))); $this->out(__('Validation: %s', print_r($validate, true)));
} }
if (!empty($associations)) { if (!empty($associations)) {
$this->out(__('Associations:')); $this->out(__('Associations:'));
@ -367,8 +367,8 @@ class ModelTask extends BakeTask {
while ($anotherValidator == 'y') { while ($anotherValidator == 'y') {
if ($this->interactive) { if ($this->interactive) {
$this->out(); $this->out();
$this->out(sprintf(__('Field: %s'), $fieldName)); $this->out(__('Field: %s', $fieldName));
$this->out(sprintf(__('Type: %s'), $metaData['type'])); $this->out(__('Type: %s', $metaData['type']));
$this->hr(); $this->hr();
$this->out(__('Please select one of the following validation options:')); $this->out(__('Please select one of the following validation options:'));
$this->hr(); $this->hr();
@ -378,7 +378,7 @@ class ModelTask extends BakeTask {
for ($i = 1; $i < $defaultChoice; $i++) { for ($i = 1; $i < $defaultChoice; $i++) {
$prompt .= $i . ' - ' . $this->_validations[$i] . "\n"; $prompt .= $i . ' - ' . $this->_validations[$i] . "\n";
} }
$prompt .= sprintf(__("%s - Do not do any validation on this field.\n"), $defaultChoice); $prompt .= __("%s - Do not do any validation on this field.\n", $defaultChoice);
$prompt .= __("... or enter in a valid regex validation string.\n"); $prompt .= __("... or enter in a valid regex validation string.\n");
$methods = array_flip($this->_validations); $methods = array_flip($this->_validations);
@ -646,7 +646,7 @@ class ModelTask extends BakeTask {
$this->hr(); $this->hr();
$alias = $this->in(__('What is the alias for this association?')); $alias = $this->in(__('What is the alias for this association?'));
$className = $this->in(sprintf(__('What className will %s use?'), $alias), null, $alias ); $className = $this->in(__('What className will %s use?', $alias), null, $alias );
$suggestedForeignKey = null; $suggestedForeignKey = null;
if ($assocType == 0) { if ($assocType == 0) {
@ -800,7 +800,7 @@ class ModelTask extends BakeTask {
if (array_search($useTable, $this->_tables) === false) { if (array_search($useTable, $this->_tables) === false) {
$this->out(); $this->out();
$this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'"), $modelName, $fullTableName)); $this->out(__("Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
$tableIsGood = $this->in(__('Do you want to use this table?'), array('y','n'), 'y'); $tableIsGood = $this->in(__('Do you want to use this table?'), array('y','n'), 'y');
} }
if (strtolower($tableIsGood) == 'n') { if (strtolower($tableIsGood) == 'n') {

View file

@ -56,8 +56,8 @@ class PluginTask extends Shell {
$plugin = Inflector::camelize($this->args[0]); $plugin = Inflector::camelize($this->args[0]);
$pluginPath = $this->_pluginPath($plugin); $pluginPath = $this->_pluginPath($plugin);
if (is_dir($pluginPath)) { if (is_dir($pluginPath)) {
$this->out(sprintf(__('Plugin: %s'), $plugin)); $this->out(__('Plugin: %s', $plugin));
$this->out(sprintf(__('Path: %s'), $pluginPath)); $this->out(__('Path: %s', $pluginPath));
} else { } else {
$this->_interactive($plugin); $this->_interactive($plugin);
} }
@ -78,7 +78,7 @@ class PluginTask extends Shell {
} }
if (!$this->bake($plugin)) { if (!$this->bake($plugin)) {
$this->error(sprintf(__("An error occured trying to bake: %s in %s"), $plugin, $this->path . Inflector::underscore($pluginPath))); $this->error(__("An error occured trying to bake: %s in %s", $plugin, $this->path . Inflector::underscore($pluginPath)));
} }
} }
@ -97,8 +97,8 @@ class PluginTask extends Shell {
$this->findPath($pathOptions); $this->findPath($pathOptions);
} }
$this->hr(); $this->hr();
$this->out(sprintf(__("<info>Plugin Name:</info> %s"), $plugin)); $this->out(__("<info>Plugin Name:</info> %s", $plugin));
$this->out(sprintf(__("<info>Plugin Directory:</info> %s"), $this->path . $pluginPath)); $this->out(__("<info>Plugin Directory:</info> %s", $this->path . $pluginPath));
$this->hr(); $this->hr();
$looksGood = $this->in(__('Look okay?'), array('y', 'n', 'q'), 'y'); $looksGood = $this->in(__('Look okay?'), array('y', 'n', 'q'), 'y');
@ -156,7 +156,7 @@ class PluginTask extends Shell {
$this->createFile($this->path . $pluginPath . DS . $modelFileName, $out); $this->createFile($this->path . $pluginPath . DS . $modelFileName, $out);
$this->hr(); $this->hr();
$this->out(sprintf(__('<success>Created:</success> %s in %s'), $plugin, $this->path . $pluginPath), 2); $this->out(__('<success>Created:</success> %s in %s', $plugin, $this->path . $pluginPath), 2);
} }
return true; return true;

View file

@ -68,7 +68,7 @@ class ProjectTask extends Shell {
if ($project) { if ($project) {
$response = false; $response = false;
while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) { while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) {
$prompt = sprintf(__('<warning>A project already exists in this location:</warning> %s Overwrite?'), $project); $prompt = __('<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
$response = $this->in($prompt, array('y','n'), 'n'); $response = $this->in($prompt, array('y','n'), 'n');
if (strtolower($response) === 'n') { if (strtolower($response) === 'n') {
$response = $project = false; $response = $project = false;
@ -89,23 +89,23 @@ class ProjectTask extends Shell {
if ($this->securitySalt($path) === true) { if ($this->securitySalt($path) === true) {
$this->out(__(' * Random hash key created for \'Security.salt\'')); $this->out(__(' * Random hash key created for \'Security.salt\''));
} else { } else {
$this->err(sprintf(__('Unable to generate random hash for \'Security.salt\', you should change it in %s'), CONFIGS . 'core.php')); $this->err(__('Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIGS . 'core.php'));
$success = false; $success = false;
} }
if ($this->securityCipherSeed($path) === true) { if ($this->securityCipherSeed($path) === true) {
$this->out(__(' * Random seed created for \'Security.cipherSeed\'')); $this->out(__(' * Random seed created for \'Security.cipherSeed\''));
} else { } else {
$this->err(sprintf(__('Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s'), CONFIGS . 'core.php')); $this->err(__('Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIGS . 'core.php'));
$success = false; $success = false;
} }
if ($this->corePath($path) === true) { if ($this->corePath($path) === true) {
$this->out(sprintf(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php'), CAKE_CORE_INCLUDE_PATH)); $this->out(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', CAKE_CORE_INCLUDE_PATH));
$this->out(sprintf(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php'), CAKE_CORE_INCLUDE_PATH)); $this->out(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php', CAKE_CORE_INCLUDE_PATH));
$this->out(__(' * <warning>Remember to check these value after moving to production server</warning>')); $this->out(__(' * <warning>Remember to check these value after moving to production server</warning>'));
} else { } else {
$this->err(sprintf(__('Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s'), $path . 'webroot' .DS .'index.php')); $this->err(__('Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', $path . 'webroot' .DS .'index.php'));
$success = false; $success = false;
} }
if ($this->consolePath($path) === true) { if ($this->consolePath($path) === true) {
@ -117,8 +117,8 @@ class ProjectTask extends Shell {
$Folder = new Folder($path); $Folder = new Folder($path);
if (!$Folder->chmod($path . 'tmp', 0777)) { if (!$Folder->chmod($path . 'tmp', 0777)) {
$this->err(sprintf(__('Could not set permissions on %s'), $path . DS .'tmp')); $this->err(__('Could not set permissions on %s', $path . DS .'tmp'));
$this->out(sprintf(__('chmod -R 0777 %s'), $path . DS .'tmp')); $this->out(__('chmod -R 0777 %s', $path . DS .'tmp'));
$success = false; $success = false;
} }
if ($success) { if ($success) {
@ -146,7 +146,7 @@ class ProjectTask extends Shell {
$skel = $this->params['skel']; $skel = $this->params['skel'];
} }
while (!$skel) { while (!$skel) {
$skel = $this->in(sprintf(__("What is the path to the directory layout you wish to copy?\nExample: %s"), APP, null, ROOT . DS . 'myapp' . DS)); $skel = $this->in(__("What is the path to the directory layout you wish to copy?\nExample: %s", APP, null, ROOT . DS . 'myapp' . DS));
if ($skel == '') { if ($skel == '') {
$this->err(__('The directory path you supplied was empty. Please try again.')); $this->err(__('The directory path you supplied was empty. Please try again.'));
} else { } else {
@ -172,10 +172,10 @@ class ProjectTask extends Shell {
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) { if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
$this->hr(); $this->hr();
$this->out(sprintf(__('<success>Created:</success> %s in %s'), $app, $path)); $this->out(__('<success>Created:</success> %s in %s', $app, $path));
$this->hr(); $this->hr();
} else { } else {
$this->err(sprintf(__("<error>Could not create</error> '%s' properly."), $app)); $this->err(__("<error>Could not create</error> '%s' properly.", $app));
return false; return false;
} }

View file

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

View file

@ -92,13 +92,13 @@ class TestTask extends BakeTask {
$this->interactive = true; $this->interactive = true;
$this->hr(); $this->hr();
$this->out(__('Bake Tests')); $this->out(__('Bake Tests'));
$this->out(sprintf(__('Path: %s'), $this->path)); $this->out(__('Path: %s', $this->path));
$this->hr(); $this->hr();
if ($type) { if ($type) {
$type = Inflector::camelize($type); $type = Inflector::camelize($type);
if (!in_array($type, $this->classTypes)) { if (!in_array($type, $this->classTypes)) {
$this->error(sprintf('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes))); $this->error(__('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
} }
} else { } else {
$type = $this->getObjectType(); $type = $this->getObjectType();
@ -180,7 +180,7 @@ class TestTask extends BakeTask {
*/ */
public function getClassName($objectType) { public function getClassName($objectType) {
$options = App::objects(strtolower($objectType)); $options = App::objects(strtolower($objectType));
$this->out(sprintf(__('Choose a %s class'), $objectType)); $this->out(__('Choose a %s class', $objectType));
$keys = array(); $keys = array();
foreach ($options as $key => $option) { foreach ($options as $key => $option) {
$this->out(++$key . '. ' . $option); $this->out(++$key . '. ' . $option);

View file

@ -221,7 +221,7 @@ class ViewTask extends BakeTask {
$this->controllerPath = strtolower(Inflector::underscore($this->controllerName)); $this->controllerPath = strtolower(Inflector::underscore($this->controllerName));
$prompt = sprintf(__("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist."), $this->controllerName); $prompt = __("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", $this->controllerName);
$interactive = $this->in($prompt, array('y', 'n'), 'n'); $interactive = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($interactive) == 'n') { if (strtolower($interactive) == 'n') {
@ -278,7 +278,7 @@ class ViewTask extends BakeTask {
if (!App::import('Controller', $import)) { if (!App::import('Controller', $import)) {
$file = $this->controllerPath . '_controller.php'; $file = $this->controllerPath . '_controller.php';
$this->err(sprintf(__("The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller."), $file)); $this->err(__("The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", $file));
$this->_stop(); $this->_stop();
} }
$controllerClassName = $this->controllerName . 'Controller'; $controllerClassName = $this->controllerName . 'Controller';
@ -339,9 +339,9 @@ class ViewTask extends BakeTask {
$this->hr(); $this->hr();
$this->out(__('The following view will be created:')); $this->out(__('The following view will be created:'));
$this->hr(); $this->hr();
$this->out(sprintf(__('Controller Name: %s'), $this->controllerName)); $this->out(__('Controller Name: %s', $this->controllerName));
$this->out(sprintf(__('Action Name: %s'), $action)); $this->out(__('Action Name: %s', $action));
$this->out(sprintf(__('Path: %s'), $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp")); $this->out(__('Path: %s', $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"));
$this->hr(); $this->hr();
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y'); $looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') { if (strtolower($looksGood) == 'y') {

View file

@ -77,7 +77,7 @@
$this->Session->setFlash(__('Invalid <?php echo strtolower($singularHumanName); ?>')); $this->Session->setFlash(__('Invalid <?php echo strtolower($singularHumanName); ?>'));
$this->redirect(array('action' => 'index')); $this->redirect(array('action' => 'index'));
<?php else: ?> <?php else: ?>
$this->flash(sprintf(__('Invalid <?php echo strtolower($singularHumanName); ?>')), array('action' => 'index')); $this->flash(__('Invalid <?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
<?php endif; ?> <?php endif; ?>
} }
if ($this->request->is('post')) { if ($this->request->is('post')) {
@ -123,7 +123,7 @@
$this->Session->setFlash(__('Invalid id for <?php echo strtolower($singularHumanName); ?>')); $this->Session->setFlash(__('Invalid id for <?php echo strtolower($singularHumanName); ?>'));
$this->redirect(array('action'=>'index')); $this->redirect(array('action'=>'index'));
<?php else: ?> <?php else: ?>
$this->flash(sprintf(__('Invalid <?php echo strtolower($singularHumanName); ?>')), array('action' => 'index')); $this->flash(__('Invalid <?php echo strtolower($singularHumanName); ?>'), array('action' => 'index'));
<?php endif; ?> <?php endif; ?>
} }
if ($this-><?php echo $currentModelName; ?>->delete($id)) { if ($this-><?php echo $currentModelName; ?>->delete($id)) {

View file

@ -47,7 +47,7 @@
<ul> <ul>
<?php if (strpos($action, 'add') === false): ?> <?php if (strpos($action, 'add') === false): ?>
<li><?php echo "<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?'), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li> <li><?php echo "<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
<?php endif;?> <?php endif;?>
<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?></li> <li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?></li>
<?php <?php

View file

@ -24,7 +24,7 @@ endif;
\$settings = Cache::settings(); \$settings = Cache::settings();
if (!empty(\$settings)): if (!empty(\$settings)):
echo '<span class=\"notice success\">'; echo '<span class=\"notice success\">';
printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), '<em>'. \$settings['engine'] . 'Engine</em>'); echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. \$settings['engine'] . 'Engine</em>');
echo '</span>'; echo '</span>';
else: else:
echo '<span class=\"notice\">'; echo '<span class=\"notice\">';
@ -75,9 +75,9 @@ $output .= "<?php endif;?>\n";
$output .= "<h3><?php echo __('Editing this Page') ?></h3>\n"; $output .= "<h3><?php echo __('Editing this Page') ?></h3>\n";
$output .= "<p>\n"; $output .= "<p>\n";
$output .= "<?php\n"; $output .= "<?php\n";
$output .= "\tprintf(__('To change the content of this page, edit: %s\n"; $output .= "\techo __('To change the content of this page, edit: %s\n";
$output .= "\t\tTo change its layout, edit: %s\n"; $output .= "\t\tTo change its layout, edit: %s\n";
$output .= "\t\tYou can also add some CSS styles for your pages at: %s'),\n"; $output .= "\t\tYou can also add some CSS styles for your pages at: %s',\n";
$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n"; $output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n";
$output .= "?>\n"; $output .= "?>\n";
$output .= "</p>\n"; $output .= "</p>\n";

View file

@ -55,7 +55,7 @@
echo "\t\t<td class=\"actions\">\n"; echo "\t\t<td class=\"actions\">\n";
echo "\t\t\t<?php echo \$this->Html->link(__('View'), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; echo "\t\t\t<?php echo \$this->Html->link(__('View'), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\t<?php echo \$this->Html->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; echo "\t\t\t<?php echo \$this->Html->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t\t<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?'), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; echo "\t\t\t<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
echo "\t\t</td>\n"; echo "\t\t</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";

View file

@ -46,7 +46,7 @@ foreach ($fields as $field) {
<ul> <ul>
<?php <?php
echo "\t\t<li><?php echo \$this->Html->link(__('Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; echo "\t\t<li><?php echo \$this->Html->link(__('Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?'), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; echo "\t\t<li><?php echo \$this->Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?> </li>\n"; echo "\t\t<li><?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?> </li>\n";
echo "\t\t<li><?php echo \$this->Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?> </li>\n"; echo "\t\t<li><?php echo \$this->Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?> </li>\n";
@ -129,7 +129,7 @@ echo "\t<?php
echo "\t\t\t<td class=\"actions\">\n"; echo "\t\t\t<td class=\"actions\">\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('View'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; echo "\t\t\t\t<?php echo \$this->Html->link(__('View'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t\t<?php echo \$this->Html->link(__('Edit'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; echo "\t\t\t\t<?php echo \$this->Html->link(__('Edit'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t\t<?php echo \$this->Form->postLink(__('Delete'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, sprintf(__('Are you sure you want to delete # %s?'), \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; echo "\t\t\t\t<?php echo \$this->Form->postLink(__('Delete'), array('controller' => '{$details['controller']}', 'action' => 'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, __('Are you sure you want to delete # %s?', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n";
echo "\t\t\t</td>\n"; echo "\t\t\t</td>\n";
echo "\t\t</tr>\n"; echo "\t\t</tr>\n";

View file

@ -274,7 +274,7 @@ class Cache {
self::set(null, $config); self::set(null, $config);
if ($success === false && $value !== '') { if ($success === false && $value !== '') {
trigger_error( trigger_error(
sprintf(__("%s cache was unable to write '%s' to cache", true), $config, $key), __("%s cache was unable to write '%s' to cache", $config, $key),
E_USER_WARNING E_USER_WARNING
); );
} }

View file

@ -298,7 +298,7 @@ class FileEngine extends CacheEngine {
$dir = new SplFileInfo($this->settings['path']); $dir = new SplFileInfo($this->settings['path']);
if ($this->_init && !($dir->isDir() && $dir->isWritable())) { if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false; $this->_init = false;
trigger_error(sprintf(__('%s is not writable'), $this->settings['path']), E_USER_WARNING); trigger_error(__('%s is not writable', $this->settings['path']), E_USER_WARNING);
return false; return false;
} }
return true; return true;

View file

@ -153,7 +153,7 @@ class MemcacheEngine extends CacheEngine {
public function increment($key, $offset = 1) { public function increment($key, $offset = 1) {
if ($this->settings['compress']) { if ($this->settings['compress']) {
throw new RuntimeException( throw new RuntimeException(
sprintf(__('Method increment() not implemented for compressed cache in %s'), __CLASS__) __('Method increment() not implemented for compressed cache in %s', __CLASS__)
); );
} }
return $this->__Memcache->increment($key, $offset); return $this->__Memcache->increment($key, $offset);
@ -171,7 +171,7 @@ class MemcacheEngine extends CacheEngine {
public function decrement($key, $offset = 1) { public function decrement($key, $offset = 1) {
if ($this->settings['compress']) { if ($this->settings['compress']) {
throw new RuntimeException( throw new RuntimeException(
sprintf(__('Method decrement() not implemented for compressed cache in %s'), __CLASS__) __('Method decrement() not implemented for compressed cache in %s', __CLASS__)
); );
} }
return $this->__Memcache->decrement($key, $offset); return $this->__Memcache->decrement($key, $offset);

View file

@ -134,7 +134,7 @@ class CakeLog {
} }
} }
if (!class_exists($loggerName)) { if (!class_exists($loggerName)) {
throw new Exception(sprintf(__('Could not load class %s'), $loggerName)); throw new Exception(__('Could not load class %s', $loggerName));
} }
return $loggerName; return $loggerName;
} }

View file

@ -262,12 +262,12 @@ class CakeSession {
public static function delete($name) { public static function delete($name) {
if (self::check($name)) { if (self::check($name)) {
if (in_array($name, self::$watchKeys)) { if (in_array($name, self::$watchKeys)) {
trigger_error(sprintf(__('Deleting session key {%s}'), $name), E_USER_NOTICE); trigger_error(__('Deleting session key {%s}', $name), E_USER_NOTICE);
} }
self::__overwrite($_SESSION, Set::remove($_SESSION, $name)); self::__overwrite($_SESSION, Set::remove($_SESSION, $name));
return (self::check($name) == false); return (self::check($name) == false);
} }
self::__setError(2, sprintf(__("%s doesn't exist"), $name)); self::__setError(2, __("%s doesn't exist", $name));
return false; return false;
} }
@ -452,7 +452,7 @@ class CakeSession {
} }
foreach ($write as $key => $val) { foreach ($write as $key => $val) {
if (in_array($key, self::$watchKeys)) { if (in_array($key, self::$watchKeys)) {
trigger_error(sprintf(__('Writing session key {%s}: %s'), $key, Debugger::exportVar($val)), E_USER_NOTICE); trigger_error(__('Writing session key {%s}: %s', $key, Debugger::exportVar($val)), E_USER_NOTICE);
} }
self::__overwrite($_SESSION, Set::insert($_SESSION, $key, $val)); self::__overwrite($_SESSION, Set::insert($_SESSION, $key, $val));
if (Set::classicExtract($_SESSION, $key) !== $val) { if (Set::classicExtract($_SESSION, $key) !== $val) {
@ -562,7 +562,7 @@ class CakeSession {
App::import('Core', 'session/' . $class); App::import('Core', 'session/' . $class);
} }
if (!class_exists($class)) { if (!class_exists($class)) {
throw new Exception(sprintf(__('Could not load %s to handle the session.'), $class)); throw new Exception(__('Could not load %s to handle the session.', $class));
} }
$handler = new $class(); $handler = new $class();
if ($handler instanceof CakeSessionHandlerInterface) { if ($handler instanceof CakeSessionHandlerInterface) {

View file

@ -147,7 +147,7 @@ class ClassRegistry {
} }
if (!isset(${$class})) { if (!isset(${$class})) {
trigger_error(sprintf(__('(ClassRegistry::init() could not create instance of %1$s class %2$s '), $class, $type), E_USER_WARNING); trigger_error(__('(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING);
return $false; return $false;
} }

View file

@ -58,7 +58,7 @@ class Configure {
self::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR, 'www_root' => WWW_ROOT)); self::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR, 'www_root' => WWW_ROOT));
if (!include(CONFIGS . 'core.php')) { if (!include(CONFIGS . 'core.php')) {
trigger_error(sprintf(__("Can't find application core file. Please create %score.php, and make sure it is readable by PHP."), CONFIGS), E_USER_ERROR); trigger_error(__("Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
} }
if (Configure::read('Cache.disable') !== true) { if (Configure::read('Cache.disable') !== true) {
@ -100,7 +100,7 @@ class Configure {
App::init(); App::init();
App::build(); App::build();
if (!include(CONFIGS . 'bootstrap.php')) { if (!include(CONFIGS . 'bootstrap.php')) {
trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP."), CONFIGS), E_USER_ERROR); trigger_error(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
} }
$level = -1; $level = -1;
if (isset(self::$_values['Error']['level'])) { if (isset(self::$_values['Error']['level'])) {
@ -299,7 +299,7 @@ class Configure {
} }
if (!isset($config)) { if (!isset($config)) {
trigger_error(sprintf(__('Configure::load() - no variable $config found in %s.php'), $fileName), E_USER_WARNING); trigger_error(__('Configure::load() - no variable $config found in %s.php', $fileName), E_USER_WARNING);
return false; return false;
} }
return self::write($config); return self::write($config);

View file

@ -68,7 +68,7 @@ class AclComponent extends Component {
list($plugin, $name) = pluginSplit($name); list($plugin, $name) = pluginSplit($name);
$name .= 'Component'; $name .= 'Component';
} else { } else {
throw new Exception(sprintf(__('Could not find %s.'), $name)); throw new Exception(__('Could not find %s.', $name));
} }
} }
$this->adapter($name); $this->adapter($name);
@ -316,7 +316,7 @@ class DbAcl extends Object implements AclInterface {
$acoNode = $acoPath[0]; $acoNode = $acoPath[0];
if ($action != '*' && !in_array('_' . $action, $permKeys)) { if ($action != '*' && !in_array('_' . $action, $permKeys)) {
trigger_error(sprintf(__("ACO permissions key %s does not exist in DbAcl::check()"), $action), E_USER_NOTICE); trigger_error(__("ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
return false; return false;
} }

View file

@ -523,7 +523,7 @@ class AuthComponent extends Component {
case 'crud': case 'crud':
if (!isset($this->actionMap[$this->request['action']])) { if (!isset($this->actionMap[$this->request['action']])) {
trigger_error( trigger_error(
sprintf(__('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"'), $this->request['action'], $this->request['controller']), __('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', $this->request['action'], $this->request['controller']),
E_USER_WARNING E_USER_WARNING
); );
} else { } else {
@ -547,13 +547,13 @@ class AuthComponent extends Component {
$action = $this->action(':action'); $action = $this->action(':action');
} }
if (empty($object)) { if (empty($object)) {
trigger_error(sprintf(__('Could not find %s. Set AuthComponent::$object in beforeFilter() or pass a valid object'), get_class($object)), E_USER_WARNING); trigger_error(__('Could not find %s. Set AuthComponent::$object in beforeFilter() or pass a valid object', get_class($object)), E_USER_WARNING);
return; return;
} }
if (method_exists($object, 'isAuthorized')) { if (method_exists($object, 'isAuthorized')) {
$valid = $object->isAuthorized($user, $this->action(':controller'), $action); $valid = $object->isAuthorized($user, $this->action(':controller'), $action);
} elseif ($object) { } elseif ($object) {
trigger_error(sprintf(__('%s::isAuthorized() is not defined.'), get_class($object)), E_USER_WARNING); trigger_error(__('%s::isAuthorized() is not defined.', get_class($object)), E_USER_WARNING);
} }
break; break;
case null: case null:

View file

@ -174,7 +174,7 @@ class CakeException extends RuntimeException {
public function __construct($message, $code = 500) { public function __construct($message, $code = 500) {
if (is_array($message)) { if (is_array($message)) {
$this->_attributes = $message; $this->_attributes = $message;
$message = vsprintf(__($this->_messageTemplate), $message); $message = __($this->_messageTemplate, $message);
} }
parent::__construct($message, $code); parent::__construct($message, $code);
} }

View file

@ -359,11 +359,11 @@ class Folder {
if ($recursive === false && is_dir($path)) { if ($recursive === false && is_dir($path)) {
if (@chmod($path, intval($mode, 8))) { if (@chmod($path, intval($mode, 8))) {
$this->__messages[] = sprintf(__('%s changed to %s'), $path, $mode); $this->__messages[] = __('%s changed to %s', $path, $mode);
return true; return true;
} }
$this->__errors[] = sprintf(__('%s NOT changed to %s'), $path, $mode); $this->__errors[] = __('%s NOT changed to %s', $path, $mode);
return false; return false;
} }
@ -380,9 +380,9 @@ class Folder {
} }
if (@chmod($fullpath, intval($mode, 8))) { if (@chmod($fullpath, intval($mode, 8))) {
$this->__messages[] = sprintf(__('%s changed to %s'), $fullpath, $mode); $this->__messages[] = __('%s changed to %s', $fullpath, $mode);
} else { } else {
$this->__errors[] = sprintf(__('%s NOT changed to %s'), $fullpath, $mode); $this->__errors[] = __('%s NOT changed to %s', $fullpath, $mode);
} }
} }
} }
@ -467,7 +467,7 @@ class Folder {
} }
if (is_file($pathname)) { if (is_file($pathname)) {
$this->__errors[] = sprintf(__('%s is a file'), $pathname); $this->__errors[] = __('%s is a file', $pathname);
return false; return false;
} }
$pathname = rtrim($pathname, DS); $pathname = rtrim($pathname, DS);
@ -478,11 +478,11 @@ class Folder {
$old = umask(0); $old = umask(0);
if (mkdir($pathname, $mode)) { if (mkdir($pathname, $mode)) {
umask($old); umask($old);
$this->__messages[] = sprintf(__('%s created'), $pathname); $this->__messages[] = __('%s created', $pathname);
return true; return true;
} else { } else {
umask($old); umask($old);
$this->__errors[] = sprintf(__('%s NOT created'), $pathname); $this->__errors[] = __('%s NOT created', $pathname);
return false; return false;
} }
} }
@ -555,9 +555,9 @@ class Folder {
} }
if (is_file($file) === true) { if (is_file($file) === true) {
if (@unlink($file)) { if (@unlink($file)) {
$this->__messages[] = sprintf(__('%s removed'), $file); $this->__messages[] = __('%s removed', $file);
} else { } else {
$this->__errors[] = sprintf(__('%s NOT removed'), $file); $this->__errors[] = __('%s NOT removed', $file);
} }
} elseif (is_dir($file) === true && $this->delete($file) === false) { } elseif (is_dir($file) === true && $this->delete($file) === false) {
return false; return false;
@ -566,10 +566,10 @@ class Folder {
} }
$path = substr($path, 0, strlen($path) - 1); $path = substr($path, 0, strlen($path) - 1);
if (rmdir($path) === false) { if (rmdir($path) === false) {
$this->__errors[] = sprintf(__('%s NOT removed'), $path); $this->__errors[] = __('%s NOT removed', $path);
return false; return false;
} else { } else {
$this->__messages[] = sprintf(__('%s removed'), $path); $this->__messages[] = __('%s removed', $path);
} }
} }
return true; return true;
@ -604,7 +604,7 @@ class Folder {
$mode = $options['mode']; $mode = $options['mode'];
if (!$this->cd($fromDir)) { if (!$this->cd($fromDir)) {
$this->__errors[] = sprintf(__('%s not found'), $fromDir); $this->__errors[] = __('%s not found', $fromDir);
return false; return false;
} }
@ -613,7 +613,7 @@ class Folder {
} }
if (!is_writable($toDir)) { if (!is_writable($toDir)) {
$this->__errors[] = sprintf(__('%s not writable'), $toDir); $this->__errors[] = __('%s not writable', $toDir);
return false; return false;
} }
@ -627,9 +627,9 @@ class Folder {
if (copy($from, $to)) { if (copy($from, $to)) {
chmod($to, intval($mode, 8)); chmod($to, intval($mode, 8));
touch($to, filemtime($from)); touch($to, filemtime($from));
$this->__messages[] = sprintf(__('%s copied to %s'), $from, $to); $this->__messages[] = __('%s copied to %s', $from, $to);
} else { } else {
$this->__errors[] = sprintf(__('%s NOT copied to %s'), $from, $to); $this->__errors[] = __('%s NOT copied to %s', $from, $to);
} }
} }
@ -640,11 +640,11 @@ class Folder {
$old = umask(0); $old = umask(0);
chmod($to, $mode); chmod($to, $mode);
umask($old); umask($old);
$this->__messages[] = sprintf(__('%s created'), $to); $this->__messages[] = __('%s created', $to);
$options = array_merge($options, array('to'=> $to, 'from'=> $from)); $options = array_merge($options, array('to'=> $to, 'from'=> $from));
$this->copy($options); $this->copy($options);
} else { } else {
$this->__errors[] = sprintf(__('%s not created'), $to); $this->__errors[] = __('%s not created', $to);
} }
} }
} }

View file

@ -528,7 +528,7 @@ class HttpSocket extends CakeSocket {
if (!is_callable(array(&$this, $decodeMethod))) { if (!is_callable(array(&$this, $decodeMethod))) {
if (!$this->quirksMode) { if (!$this->quirksMode) {
trigger_error(sprintf(__('HttpSocket::_decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.'), h($encoding)), E_USER_WARNING); trigger_error(__('HttpSocket::_decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.', h($encoding)), E_USER_WARNING);
} }
return array('body' => $body, 'header' => false); return array('body' => $body, 'header' => false);
} }
@ -825,7 +825,7 @@ class HttpSocket extends CakeSocket {
$request['uri'] = $this->_buildUri($request['uri'], '/%path?%query'); $request['uri'] = $this->_buildUri($request['uri'], '/%path?%query');
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) { if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
trigger_error(sprintf(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.'), join(',', $asteriskMethods)), E_USER_WARNING); trigger_error(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', implode(',', $asteriskMethods)), E_USER_WARNING);
return false; return false;
} }
return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak; return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak;

View file

@ -203,7 +203,7 @@ class BehaviorCollection extends ObjectCollection {
$call = null; $call = null;
if ($strict && !$found) { if ($strict && !$found) {
trigger_error(sprintf(__("BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior"), $method), E_USER_WARNING); trigger_error(__("BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", $method), E_USER_WARNING);
return null; return null;
} elseif ($found) { } elseif ($found) {
$methods = array_combine($methods, array_values($this->__methods)); $methods = array_combine($methods, array_values($this->__methods));

View file

@ -56,7 +56,7 @@ class AclBehavior extends ModelBehavior {
} }
$model->{$type} = ClassRegistry::init($type); $model->{$type} = ClassRegistry::init($type);
if (!method_exists($model, 'parentNode')) { if (!method_exists($model, 'parentNode')) {
trigger_error(sprintf(__('Callback parentNode() not defined in %s'), $model->alias), E_USER_WARNING); trigger_error(__('Callback parentNode() not defined in %s', $model->alias), E_USER_WARNING);
} }
} }

View file

@ -354,7 +354,7 @@ class ContainableBehavior extends ModelBehavior {
if (!isset($Model->{$name}) || !is_object($Model->{$name})) { if (!isset($Model->{$name}) || !is_object($Model->{$name})) {
if ($throwErrors) { if ($throwErrors) {
trigger_error(sprintf(__('Model "%s" is not associated with model "%s"'), $Model->alias, $name), E_USER_WARNING); trigger_error(__('Model "%s" is not associated with model "%s"', $Model->alias, $name), E_USER_WARNING);
} }
continue; continue;
} }

View file

@ -55,7 +55,7 @@ class TranslateBehavior extends ModelBehavior {
$db = ConnectionManager::getDataSource($model->useDbConfig); $db = ConnectionManager::getDataSource($model->useDbConfig);
if (!$db->connected) { if (!$db->connected) {
trigger_error( trigger_error(
sprintf(__('Datasource %s for TranslateBehavior of model %s is not connected'), $model->useDbConfig, $model->alias), __('Datasource %s for TranslateBehavior of model %s is not connected', $model->useDbConfig, $model->alias),
E_USER_ERROR E_USER_ERROR
); );
return false; return false;
@ -439,7 +439,7 @@ class TranslateBehavior extends ModelBehavior {
foreach (array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany') as $type) { foreach (array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany') as $type) {
if (isset($model->{$type}[$association]) || isset($model->__backAssociation[$type][$association])) { if (isset($model->{$type}[$association]) || isset($model->__backAssociation[$type][$association])) {
trigger_error( trigger_error(
sprintf(__('Association %s is already binded to model %s'), $association, $model->alias), __('Association %s is already binded to model %s', $association, $model->alias),
E_USER_ERROR E_USER_ERROR
); );
return false; return false;

View file

@ -587,7 +587,7 @@ class CakeSchema extends Object {
$value['key'] = 'primary'; $value['key'] = 'primary';
} }
if (!isset($db->columns[$value['type']])) { if (!isset($db->columns[$value['type']])) {
trigger_error(sprintf(__('Schema generation error: invalid column type %s does not exist in DBO'), $value['type']), E_USER_NOTICE); trigger_error(__('Schema generation error: invalid column type %s does not exist in DBO', $value['type']), E_USER_NOTICE);
continue; continue;
} else { } else {
$defaultCol = $db->columns[$value['type']]; $defaultCol = $db->columns[$value['type']];

View file

@ -95,7 +95,7 @@ class ConnectionManager {
} }
if (empty($_this->_connectionsEnum[$name])) { if (empty($_this->_connectionsEnum[$name])) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Non-existent data source %s"), $name), E_USER_ERROR); trigger_error(__("ConnectionManager::getDataSource - Non-existent data source %s", $name), E_USER_ERROR);
$null = null; $null = null;
return $null; return $null;
} }
@ -103,7 +103,7 @@ class ConnectionManager {
$class = $conn['classname']; $class = $conn['classname'];
if ($_this->loadDataSource($name) === null) { if ($_this->loadDataSource($name) === null) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s"), $class), E_USER_ERROR); trigger_error(__("ConnectionManager::getDataSource - Could not load class %s", $class), E_USER_ERROR);
$null = null; $null = null;
return $null; return $null;
} }
@ -172,7 +172,7 @@ class ConnectionManager {
$class = "{$conn['plugin']}.{$conn['classname']}"; $class = "{$conn['plugin']}.{$conn['classname']}";
if (!App::import('Datasource', $class, !is_null($conn['plugin']))) { if (!App::import('Datasource', $class, !is_null($conn['plugin']))) {
trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s'), $class), E_USER_ERROR); trigger_error(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', $class), E_USER_ERROR);
return null; return null;
} }
return true; return true;

View file

@ -978,7 +978,7 @@ class DboOracle extends DboSource {
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) { if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
if (!isset($resultSet) || !is_array($resultSet)) { if (!isset($resultSet) || !is_array($resultSet)) {
if (Configure::read('debug') > 0) { if (Configure::read('debug') > 0) {
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . sprintf(__('SQL Error in model %s:'), $model->alias) . ' '; echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __('SQL Error in model %s:', $model->alias) . ' ';
if (isset($this->error) && $this->error != null) { if (isset($this->error) && $this->error != null) {
echo $this->error; echo $this->error;
} }

View file

@ -493,7 +493,7 @@ class DboSqlite extends DboSource {
} }
if (!isset($this->columns[$type])) { if (!isset($this->columns[$type])) {
trigger_error(sprintf(__('Column type %s does not exist'), $type), E_USER_WARNING); trigger_error(__('Column type %s does not exist', $type), E_USER_WARNING);
return null; return null;
} }

View file

@ -662,7 +662,7 @@ class DboSource extends DataSource {
if ($error) { if ($error) {
trigger_error('<span style="color:Red;text-align:left"><b>' . __('SQL Error:') . "</b> {$this->error}</span>", E_USER_WARNING); trigger_error('<span style="color:Red;text-align:left"><b>' . __('SQL Error:') . "</b> {$this->error}</span>", E_USER_WARNING);
} else { } else {
$out = ('<small>[' . sprintf(__('Aff:%s Num:%s Took:%sms'), $this->affected, $this->numRows, $this->took) . ']</small>'); $out = ('<small>[' . __('Aff:%s Num:%s Took:%sms', $this->affected, $this->numRows, $this->took) . ']</small>');
} }
pr(sprintf('<p style="text-align:left"><b>' . __('Query:') . '</b> %s %s</p>', $sql, $out)); pr(sprintf('<p style="text-align:left"><b>' . __('Query:') . '</b> %s %s</p>', $sql, $out));
} }
@ -897,7 +897,7 @@ class DboSource extends DataSource {
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) { if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
if (!isset($resultSet) || !is_array($resultSet)) { if (!isset($resultSet) || !is_array($resultSet)) {
if (Configure::read('debug') > 0) { if (Configure::read('debug') > 0) {
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . sprintf(__('SQL Error in model %s:'), $model->alias) . ' '; echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __('SQL Error in model %s:', $model->alias) . ' ';
if (isset($this->error) && $this->error != null) { if (isset($this->error) && $this->error != null) {
echo $this->error; echo $this->error;
} }
@ -2666,7 +2666,7 @@ class DboSource extends DataSource {
} }
if (!isset($this->columns[$type])) { if (!isset($this->columns[$type])) {
trigger_error(sprintf(__('Column type %s does not exist'), $type), E_USER_WARNING); trigger_error(__('Column type %s does not exist', $type), E_USER_WARNING);
return null; return null;
} }

View file

@ -138,7 +138,7 @@ class AclNode extends AppModel {
$model = ClassRegistry::init(array('class' => $name, 'alias' => $name)); $model = ClassRegistry::init(array('class' => $name, 'alias' => $name));
if (empty($model)) { if (empty($model)) {
trigger_error(sprintf(__("Model class '%s' not found in AclNode::node() when trying to bind %s object"), $type, $this->alias), E_USER_WARNING); trigger_error(__("Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias), E_USER_WARNING);
return null; return null;
} }
@ -183,7 +183,7 @@ class AclNode extends AppModel {
$result = $db->read($this, $queryData, -1); $result = $db->read($this, $queryData, -1);
if (!$result) { if (!$result) {
trigger_error(sprintf(__("AclNode::node() - Couldn't find %s node identified by \"%s\""), $type, print_r($ref, true)), E_USER_WARNING); trigger_error(__("AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)), E_USER_WARNING);
} }
} }
return $result; return $result;

View file

@ -2638,7 +2638,7 @@ class Model extends Object {
} elseif (!is_array($validator['rule'])) { } elseif (!is_array($validator['rule'])) {
$valid = preg_match($rule, $data[$fieldName]); $valid = preg_match($rule, $data[$fieldName]);
} elseif (Configure::read('debug') > 0) { } elseif (Configure::read('debug') > 0) {
trigger_error(sprintf(__('Could not find validation handler %s for %s'), $rule, $fieldName), E_USER_WARNING); trigger_error(__('Could not find validation handler %s for %s', $rule, $fieldName), E_USER_WARNING);
} }
if (!$valid || (is_string($valid) && strlen($valid) > 0)) { if (!$valid || (is_string($valid) && strlen($valid) > 0)) {
@ -2947,7 +2947,7 @@ class Model extends Object {
return array($with, array_unique(array_merge($assoc[$with], $keys))); return array($with, array_unique(array_merge($assoc[$with], $keys)));
} }
trigger_error( trigger_error(
sprintf(__('Invalid join model settings in %s'), $model->alias), __('Invalid join model settings in %s', $model->alias),
E_USER_WARNING E_USER_WARNING
); );
} }

View file

@ -714,11 +714,11 @@ class Validation {
protected static function _pass($method, $check, $classPrefix) { protected static function _pass($method, $check, $classPrefix) {
$className = ucwords($classPrefix) . 'Validation'; $className = ucwords($classPrefix) . 'Validation';
if (!class_exists($className)) { if (!class_exists($className)) {
trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING); trigger_error(__('Could not find %s class, unable to complete validation.', $className), E_USER_WARNING);
return false; return false;
} }
if (!method_exists($className, $method)) { if (!method_exists($className, $method)) {
trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.', true), $method, $className), E_USER_WARNING); trigger_error(__('Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING);
return false; return false;
} }
$check = (array)$check; $check = (array)$check;

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php printf(__('Missing Method in %s'), $controller); ?></h2> <h2><?php echo __('Missing Method in %s', $controller); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The action %1$s is not defined in controller %2$s'), '<em>' . $action . '</em>', '<em>' . $controller . '</em>'); ?> <?php echo __('The action %1$s is not defined in controller %2$s', '<em>' . $action . '</em>', '<em>' . $controller . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create %1$s%2$s in file: %3$s.'), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> <?php echo __('Create %1$s%2$s in file: %3$s.', '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -40,6 +40,6 @@ class <?php echo $controller;?> extends AppController {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Behavior Class'); ?></h2> <h2><?php echo __('Missing Behavior Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The behavior class <em>%s</em> can not be found or does not exist.'), $class); ?> <?php echo __('The behavior class <em>%s</em> can not be found or does not exist.', $class); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php echo __('Create the class below in file: %s', APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends ModelBehavior {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Behavior File'); ?></h2> <h2><?php echo __('Missing Behavior File'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The Behavior file %s can not be found or does not exist.'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php echo __('The Behavior file %s can not be found or does not exist.', APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php echo __('Create the class below in file: %s', APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends ModelBehavior {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Component Class'); ?></h2> <h2><?php echo __('Missing Component Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Component class %1$s was not found.'), '<em>' . $class . '</em>'); ?> <?php echo __('Component class %1$s was not found.', '<em>' . $class . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s in file: %s'), '<em>' . $class . '</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> <?php echo __('Create the class %s in file: %s', '<em>' . $class . '</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends Component {<br />
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -24,7 +24,7 @@
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s in file: %s'), '<em>' . $class . '</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> <?php echo __('Create the class %s in file: %s', '<em>' . $class . '</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends Component {<br />
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,15 +20,15 @@
<h2><?php echo __('Missing Database Connection'); ?></h2> <h2><?php echo __('Missing Database Connection'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s requires a database connection'), $class); ?> <?php echo __('%s requires a database connection', $class); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file : %s.'), APP_DIR . DS . 'config' . DS . 'database.php'); ?> <?php echo __('Confirm you have created the file : %s.', APP_DIR . DS . 'config' . DS . 'database.php'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?> <?php echo __('If you want to customize this error message, create %s.', APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Controller'); ?></h2> <h2><?php echo __('Missing Controller'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s could not be found.'), '<em>' . $controller . '</em>'); ?> <?php echo __('%s could not be found.', '<em>' . $controller . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s below in file: %s'), '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> <?php echo __('Create the class %s below in file: %s', '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $controller;?> extends AppController {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -24,11 +24,11 @@
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s'), APP_DIR . DS . 'config' . DS . 'database.php'); ?> <?php echo __('Confirm you have created the file: %s', APP_DIR . DS . 'config' . DS . 'database.php'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Helper Class'); ?></h2> <h2><?php echo __('Missing Helper Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The helper class <em>%s</em> can not be found or does not exist.'), $class); ?> <?php echo __('The helper class <em>%s</em> can not be found or does not exist.', $class); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php echo __('Create the class below in file: %s', APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends AppHelper {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?> <?php __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Helper File'); ?></h2> <h2><?php echo __('Missing Helper File'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The helper file %s can not be found or does not exist.'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php echo __('The helper file %s can not be found or does not exist.', APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php echo __('Create the class below in file: %s', APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,7 +35,7 @@ class <?php echo $class;?> extends AppHelper {
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,15 +20,15 @@
<h2><?php echo __('Missing Layout'); ?></h2> <h2><?php echo __('Missing Layout'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The layout file %s can not be found or does not exist.'), '<em>' . $file . '</em>'); ?> <?php echo __('The layout file %s can not be found or does not exist.', '<em>' . $file . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s'), '<em>' . $file . '</em>'); ?> <?php echo __('Confirm you have created the file: %s', '<em>' . $file . '</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,11 +20,11 @@
<h2><?php echo __('Missing Database Table'); ?></h2> <h2><?php echo __('Missing Database Table'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Database table %1$s for model %2$s was not found.'), '<em>' . $table . '</em>', '<em>' . $class . '</em>'); ?> <?php echo __('Database table %1$s for model %2$s was not found.', '<em>' . $table . '</em>', '<em>' . $class . '</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -20,15 +20,15 @@
<h2><?php echo __('Missing View'); ?></h2> <h2><?php echo __('Missing View'); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The view for %1$s%2$s was not found.'), '<em>' . Inflector::camelize($this->request->controller) . 'Controller::</em>', '<em>' . $this->request->action . '()</em>'); ?> <?php echo __('The view for %1$s%2$s was not found.', '<em>' . Inflector::camelize($this->request->controller) . 'Controller::</em>', '<em>' . $this->request->action . '()</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s'), $file); ?> <?php echo __('Confirm you have created the file: %s', $file); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php printf(__('Private Method in %s'), $controller); ?></h2> <h2><?php echo __('Private Method in %s', $controller); ?></h2>
<p class="error"> <p class="error">
<strong><?php echo __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s%s cannot be accessed directly.'), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>'); ?> <?php echo __('%s%s cannot be accessed directly.', '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?>
</p> </p>
<?php echo $this->element('exception_stack_trace'); ?> <?php echo $this->element('exception_stack_trace'); ?>

View file

@ -24,7 +24,7 @@
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php echo __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp'); ?> <?php echo __('If you want to customize this error message, create %s', APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php

View file

@ -129,7 +129,7 @@ class Helper extends Object {
* @param array $params Array of params for the method. * @param array $params Array of params for the method.
*/ */
public function __call($method, $params) { public function __call($method, $params) {
trigger_error(sprintf(__('Method %1$s::%2$s does not exist'), get_class($this), $method), E_USER_WARNING); trigger_error(__('Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
} }
/** /**

View file

@ -505,7 +505,7 @@ class FormHelper extends AppHelper {
if ($text != null) { if ($text != null) {
$error = $text; $error = $text;
} elseif (is_numeric($error)) { } elseif (is_numeric($error)) {
$error = sprintf(__('Error in field %s'), Inflector::humanize($this->field())); $error = __('Error in field %s', Inflector::humanize($this->field()));
} }
if ($options['escape']) { if ($options['escape']) {
$error = h($error); $error = h($error);
@ -1140,7 +1140,7 @@ class FormHelper extends AppHelper {
public function __call($method, $params) { public function __call($method, $params) {
$options = array(); $options = array();
if (empty($params)) { if (empty($params)) {
throw new Exception(sprintf(__('Missing field name for FormHelper::%s'), $method)); throw new Exception(__('Missing field name for FormHelper::%s', $method));
} }
if (isset($params[1])) { if (isset($params[1])) {
$options = $params[1]; $options = $params[1];

View file

@ -152,7 +152,7 @@ class JsHelper extends AppHelper {
if (method_exists($this, $method . '_')) { if (method_exists($this, $method . '_')) {
return call_user_func(array(&$this, $method . '_'), $params); return call_user_func(array(&$this, $method . '_'), $params);
} }
trigger_error(sprintf(__('JsHelper:: Missing Method %s is undefined'), $method), E_USER_WARNING); trigger_error(__('JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
} }
/** /**

View file

@ -88,15 +88,15 @@ class NumberHelper extends AppHelper {
public function toReadableSize($size) { public function toReadableSize($size) {
switch (true) { switch (true) {
case $size < 1024: case $size < 1024:
return sprintf(__n('%d Byte', '%d Bytes', $size), $size); return __n('%d Byte', '%d Bytes', $size, $size);
case round($size / 1024) < 1024: case round($size / 1024) < 1024:
return sprintf(__('%d KB'), $this->precision($size / 1024, 0)); return __('%d KB', $this->precision($size / 1024, 0));
case round($size / 1024 / 1024, 2) < 1024: case round($size / 1024 / 1024, 2) < 1024:
return sprintf(__('%.2f MB'), $this->precision($size / 1024 / 1024, 2)); return __('%.2f MB', $this->precision($size / 1024 / 1024, 2));
case round($size / 1024 / 1024 / 1024, 2) < 1024: case round($size / 1024 / 1024 / 1024, 2) < 1024:
return sprintf(__('%.2f GB'), $this->precision($size / 1024 / 1024 / 1024, 2)); return __('%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2));
default: default:
return sprintf(__('%.2f TB'), $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); return __('%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
} }
} }

View file

@ -224,9 +224,9 @@ class TimeHelper extends AppHelper {
$y = $this->isThisYear($date) ? '' : ' %Y'; $y = $this->isThisYear($date) ? '' : ' %Y';
if ($this->isToday($date)) { if ($this->isToday($date)) {
$ret = sprintf(__('Today, %s'), strftime("%H:%M", $date)); $ret = __('Today, %s', strftime("%H:%M", $date));
} elseif ($this->wasYesterday($date)) { } elseif ($this->wasYesterday($date)) {
$ret = sprintf(__('Yesterday, %s'), strftime("%H:%M", $date)); $ret = __('Yesterday, %s', strftime("%H:%M", $date));
} else { } else {
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
$ret = strftime($format, $date); $ret = strftime($format, $date);
@ -572,7 +572,7 @@ class TimeHelper extends AppHelper {
$diff = $futureTime - $pastTime; $diff = $futureTime - $pastTime;
if ($diff > abs($now - $this->fromString($end))) { if ($diff > abs($now - $this->fromString($end))) {
$relativeDate = sprintf(__('on %s'), date($format, $inSeconds)); $relativeDate = __('on %s', date($format, $inSeconds));
} else { } else {
if ($years > 0) { if ($years > 0) {
// years and months and days // years and months and days
@ -606,7 +606,7 @@ class TimeHelper extends AppHelper {
} }
if (!$backwards) { if (!$backwards) {
$relativeDate = sprintf(__('%s ago'), $relativeDate); $relativeDate = __('%s ago', $relativeDate);
} }
} }
return $relativeDate; return $relativeDate;

View file

@ -20,7 +20,7 @@ if (Configure::read() == 0):
$this->cakeError('error404'); $this->cakeError('error404');
endif; endif;
?> ?>
<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> <h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a> <a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a>
<?php <?php
if (Configure::read() > 0): if (Configure::read() > 0):
@ -45,7 +45,7 @@ endif;
$settings = Cache::settings(); $settings = Cache::settings();
if (!empty($settings)): if (!empty($settings)):
echo '<span class="notice success">'; echo '<span class="notice success">';
printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), '<em>'. $settings['engine'] . 'Engine</em>'); echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';

View file

@ -36,8 +36,8 @@
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }

View file

@ -76,14 +76,14 @@ echo "\n";
<div class="actions"> <div class="actions">
<h3><?php echo __('Actions'); ?></h3> <h3><?php echo __('Actions'); ?></h3>
<ul> <ul>
<li><?php echo $this->Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')); ?></li> <li><?php echo $this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')); ?></li>
<?php <?php
$done = array(); $done = array();
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }

View file

@ -18,7 +18,7 @@
*/ */
?> ?>
<div class="<?php echo $pluralVar;?> view"> <div class="<?php echo $pluralVar;?> view">
<h2><?php printf(__('View %s'), $singularHumanName); ?></h2> <h2><?php echo __('View %s', $singularHumanName); ?></h2>
<dl> <dl>
<?php <?php
$i = 0; $i = 0;
@ -50,17 +50,17 @@ foreach ($scaffoldFields as $_field) {
<h3><?php echo __('Actions'); ?></h3> <h3><?php echo __('Actions'); ?></h3>
<ul> <ul>
<?php <?php
echo "\t\t<li>" .$this->Html->link(sprintf(__('Edit %s'), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n"; echo "\t\t<li>" .$this->Html->link(__('Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('Delete %s'), $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). " </li>\n"; echo "\t\t<li>" .$this->Html->link(__('Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('List %s'), $pluralHumanName), array('action' => 'index')). " </li>\n"; echo "\t\t<li>" .$this->Html->link(__('List %s', $pluralHumanName), array('action' => 'index')). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')). " </li>\n"; echo "\t\t<li>" .$this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')). " </li>\n";
$done = array(); $done = array();
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }
@ -72,7 +72,7 @@ foreach ($scaffoldFields as $_field) {
if (!empty($associations['hasOne'])) : if (!empty($associations['hasOne'])) :
foreach ($associations['hasOne'] as $_alias => $_details): ?> foreach ($associations['hasOne'] as $_alias => $_details): ?>
<div class="related"> <div class="related">
<h3><?php printf(__("Related %s", true), Inflector::humanize($_details['controller'])); ?></h3> <h3><?php echo __("Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?> <?php if (!empty(${$singularVar}[$_alias])):?>
<dl> <dl>
<?php <?php
@ -91,7 +91,7 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
<?php endif; ?> <?php endif; ?>
<div class="actions"> <div class="actions">
<ul> <ul>
<li><?php echo $this->Html->link(sprintf(__('Edit %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n";?> <li><?php echo $this->Html->link(__('Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]))."</li>\n";?>
</ul> </ul>
</div> </div>
</div> </div>
@ -111,7 +111,7 @@ foreach ($relations as $_alias => $_details):
$otherSingularVar = Inflector::variable($_alias); $otherSingularVar = Inflector::variable($_alias);
?> ?>
<div class="related"> <div class="related">
<h3><?php printf(__("Related %s", true), Inflector::humanize($_details['controller'])); ?></h3> <h3><?php echo __("Related %s", Inflector::humanize($_details['controller'])); ?></h3>
<?php if (!empty(${$singularVar}[$_alias])):?> <?php if (!empty(${$singularVar}[$_alias])):?>
<table cellpadding="0" cellspacing="0"> <table cellpadding="0" cellspacing="0">
<tr> <tr>
@ -152,7 +152,7 @@ $otherSingularVar = Inflector::variable($_alias);
<?php endif; ?> <?php endif; ?>
<div class="actions"> <div class="actions">
<ul> <ul>
<li><?php echo $this->Html->link(sprintf(__("New %s", true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'));?> </li> <li><?php echo $this->Html->link(__("New %s", Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add'));?> </li>
</ul> </ul>
</div> </div>
</div> </div>

View file

@ -409,7 +409,7 @@ class View extends Object {
$layout = $this->layout; $layout = $this->layout;
} }
if ($this->output === false) { if ($this->output === false) {
throw new RuntimeException(sprintf(__("Error in view %s, got no content."), $viewFileName)); throw new RuntimeException(__("Error in view %s, got no content.", $viewFileName));
} }
if ($layout && $this->autoLayout) { if ($layout && $this->autoLayout) {
$this->output = $this->renderLayout($this->output, $layout); $this->output = $this->renderLayout($this->output, $layout);
@ -451,7 +451,7 @@ class View extends Object {
$this->output = $this->_render($layoutFileName); $this->output = $this->_render($layoutFileName);
if ($this->output === false) { if ($this->output === false) {
throw new RuntimeException(sprintf(__("Error in layout %s, got no content."), $layoutFileName)); throw new RuntimeException(__("Error in layout %s, got no content.", $layoutFileName));
} }
$this->Helpers->trigger('afterLayout', array($layoutFileName)); $this->Helpers->trigger('afterLayout', array($layoutFileName));

View file

@ -484,8 +484,7 @@ class FileTest extends CakeTestCase {
$assertLine = $assertLine->traceMethod(); $assertLine = $assertLine->traceMethod();
$shortPath = substr($tmpFile, strlen(ROOT)); $shortPath = substr($tmpFile, strlen(ROOT));
$message = '[FileTest] Skipping %s because "%s" not writeable!'; $message = __('[FileTest] Skipping %s because "%s" not writeable!', $caller, $shortPath).$assertLine;
$message = sprintf(__($message), $caller, $shortPath).$assertLine;
$this->_reporter->paintSkip($message); $this->_reporter->paintSkip($message);
} }
return false; return false;

View file

@ -251,7 +251,7 @@ class CakeFixtureManager {
$fixture->truncate($db); $fixture->truncate($db);
$fixture->insert($db); $fixture->insert($db);
} else { } else {
throw new UnexpectedValueException(sprintf(__('Referenced fixture class %s not found'), $name)); throw new UnexpectedValueException(__('Referenced fixture class %s not found', $name));
} }
} }

View file

@ -201,7 +201,7 @@ class CakeBaseReporter implements PHPUnit_Framework_TestListener {
* @param PHPUnit_Framework_TestSuite $suite * @param PHPUnit_Framework_TestSuite $suite
*/ */
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
echo sprintf(__('Running %s'), $suite->getName()) . "\n"; echo __('Running %s', $suite->getName()) . "\n";
} }
/** /**

View file

@ -237,7 +237,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "<li class='fail'>\n"; echo "<li class='fail'>\n";
echo "<span>Failed</span>"; echo "<span>Failed</span>";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString()) . "</pre></div>\n"; echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString()) . "</pre></div>\n";
echo "<div class='msg'>" . sprintf(__('Test case: %s'), $testName) . "</div>\n"; echo "<div class='msg'>" . __('Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n"; echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n"; echo "</li>\n";
} }
@ -275,7 +275,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "<span>Exception</span>"; echo "<span>Exception</span>";
echo "<div class='msg'>" . $this->_htmlEntities($message->getMessage()) . "</div>\n"; echo "<div class='msg'>" . $this->_htmlEntities($message->getMessage()) . "</div>\n";
echo "<div class='msg'>" . sprintf(__('Test case: %s'), $testName) . "</div>\n"; echo "<div class='msg'>" . __('Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n"; echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n"; echo "</li>\n";
} }
@ -341,6 +341,6 @@ class CakeHtmlReporter extends CakeBaseReporter {
* @param PHPUnit_Framework_TestSuite $suite * @param PHPUnit_Framework_TestSuite $suite
*/ */
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
echo '<h2>' . sprintf(__('Running %s'), $suite->getName()) . '</h2>'; echo '<h2>' . __('Running %s', $suite->getName()) . '</h2>';
} }
} }

View file

@ -152,10 +152,10 @@ class TestManager {
$testCaseFileWithPath = $this->_getTestsPath($this->params) . DS . $testCaseFile; $testCaseFileWithPath = $this->_getTestsPath($this->params) . DS . $testCaseFile;
if (!file_exists($testCaseFileWithPath) || strpos($testCaseFileWithPath, '..')) { if (!file_exists($testCaseFileWithPath) || strpos($testCaseFileWithPath, '..')) {
throw new InvalidArgumentException(sprintf(__('Unable to load test file %s'), htmlentities($testCaseFile))); throw new InvalidArgumentException(__('Unable to load test file %s', htmlentities($testCaseFile)));
} }
if (!$suite) { if (!$suite) {
$suite = $this->getTestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile)); $suite = $this->getTestSuite(__('Individual test case: %s', $testCaseFile));
} }
$suite->addTestFile($testCaseFileWithPath); $suite->addTestFile($testCaseFileWithPath);

View file

@ -17,7 +17,7 @@
$settings = array(); $settings = array();
if (!empty($settings)): if (!empty($settings)):
echo '<span class="notice success">'; echo '<span class="notice success">';
printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), '<em>'. $settings['engine'] . 'Engine</em>'); echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';
@ -66,9 +66,9 @@ if (!empty($filePresent)):
<h3><?php echo __('Editing this Page') ?></h3> <h3><?php echo __('Editing this Page') ?></h3>
<p> <p>
<?php <?php
printf(__('To change the content of this page, edit: %s echo __('To change the content of this page, edit: %s
To change its layout, edit: %s To change its layout, edit: %s
You can also add some CSS styles for your pages at: %s'), You can also add some CSS styles for your pages at: %s',
APP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css'); APP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');
?> ?>
</p> </p>

View file

@ -96,7 +96,7 @@ if (!empty($filePresent)):
</span> </span>
</p> </p>
<?php endif; ?> <?php endif; ?>
<h2><?php printf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> <h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a> <a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a>
<h2><?php __('Editing this Page'); ?></h2> <h2><?php __('Editing this Page'); ?></h2>
<p> <p>