mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '2.0' of github.com:cakephp/cakephp into 2.0
This commit is contained in:
commit
ad80609841
80 changed files with 404 additions and 268 deletions
|
@ -461,18 +461,24 @@ if (!function_exists('sortByKey')) {
|
|||
* Returns a translated string if one is found; Otherwise, the submitted message.
|
||||
*
|
||||
* @param string $singular Text to translate
|
||||
* @param boolean $return Set to true to return translated string, or false to echo
|
||||
* @return mixed translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return mixed translated string
|
||||
* @link http://book.cakephp.org/view/1121/__
|
||||
*/
|
||||
function __($singular) {
|
||||
function __($singular, $args = null) {
|
||||
if (!$singular) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($singular);
|
||||
$translated = I18n::translate($singular);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 1);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -482,17 +488,23 @@ if (!function_exists('sortByKey')) {
|
|||
* @param string $singular Singular text to translate
|
||||
* @param string $plural Plural text
|
||||
* @param integer $count Count
|
||||
* @param boolean $return true to return, false to echo
|
||||
* @return mixed plural form of translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return mixed plural form of translated string
|
||||
*/
|
||||
function __n($singular, $plural, $count) {
|
||||
function __n($singular, $plural, $count, $args = null) {
|
||||
if (!$singular) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($singular, $plural, null, 6, $count);
|
||||
$translated = I18n::translate($singular, $plural, null, 6, $count);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 3);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -500,17 +512,23 @@ if (!function_exists('sortByKey')) {
|
|||
*
|
||||
* @param string $domain Domain
|
||||
* @param string $msg String to translate
|
||||
* @param string $return true to return, false to echo
|
||||
* @return translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return translated string
|
||||
*/
|
||||
function __d($domain, $msg) {
|
||||
function __d($domain, $msg, $args = null) {
|
||||
if (!$msg) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($msg, null, $domain);
|
||||
$translated = I18n::translate($msg, null, $domain);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 2);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -522,17 +540,23 @@ if (!function_exists('sortByKey')) {
|
|||
* @param string $singular Singular string to translate
|
||||
* @param string $plural Plural
|
||||
* @param integer $count Count
|
||||
* @param boolean $return true to return, false to echo
|
||||
* @return plural form of translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return plural form of translated string
|
||||
*/
|
||||
function __dn($domain, $singular, $plural, $count) {
|
||||
function __dn($domain, $singular, $plural, $count, $args = null) {
|
||||
if (!$singular) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($singular, $plural, $domain, 6, $count);
|
||||
$translated = I18n::translate($singular, $plural, $domain, 6, $count);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 4);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -555,17 +579,23 @@ if (!function_exists('sortByKey')) {
|
|||
* @param string $domain Domain
|
||||
* @param string $msg Message to translate
|
||||
* @param integer $category Category
|
||||
* @param boolean $return true to return, false to echo
|
||||
* @return translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return translated string
|
||||
*/
|
||||
function __dc($domain, $msg, $category) {
|
||||
function __dc($domain, $msg, $category, $args = null) {
|
||||
if (!$msg) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($msg, null, $domain, $category);
|
||||
$translated = I18n::translate($msg, null, $domain, $category);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 3);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -592,17 +622,23 @@ if (!function_exists('sortByKey')) {
|
|||
* @param string $plural Plural
|
||||
* @param integer $count Count
|
||||
* @param integer $category Category
|
||||
* @param boolean $return true to return, false to echo
|
||||
* @return plural form of translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return plural form of translated string
|
||||
*/
|
||||
function __dcn($domain, $singular, $plural, $count, $category) {
|
||||
function __dcn($domain, $singular, $plural, $count, $category, $args = null) {
|
||||
if (!$singular) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($singular, $plural, $domain, $category, $count);
|
||||
$translated = I18n::translate($singular, $plural, $domain, $category, $count);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 5);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -621,17 +657,23 @@ if (!function_exists('sortByKey')) {
|
|||
*
|
||||
* @param string $msg String to translate
|
||||
* @param integer $category Category
|
||||
* @param string $return true to return, false to echo
|
||||
* @return translated string if $return is false string will be echoed
|
||||
* @param mixed $args Array with arguments or multiple arguments in function
|
||||
* @return translated string
|
||||
*/
|
||||
function __c($msg, $category) {
|
||||
function __c($msg, $category, $args = null) {
|
||||
if (!$msg) {
|
||||
return;
|
||||
}
|
||||
if (!class_exists('I18n')) {
|
||||
App::import('Core', 'i18n');
|
||||
}
|
||||
return I18n::translate($msg, null, null, $category);
|
||||
$translated = I18n::translate($msg, null, null, $category);
|
||||
if ($args === null) {
|
||||
return $translated;
|
||||
} elseif (!is_array($args)) {
|
||||
$args = array_slice(func_get_args(), 2);
|
||||
}
|
||||
return vsprintf($translated, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -75,8 +75,8 @@ class ConsoleErrorHandler extends ErrorHandler {
|
|||
}
|
||||
$stderr = self::getStderr();
|
||||
list($name, $log) = self::_mapErrorCode($code);
|
||||
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);
|
||||
$stderr->write(sprintf(__("<error>%s Error:</error> %s\n"), $name, $message));
|
||||
$message = __('%s in [%s, line %s]', $description, $file, $line);
|
||||
$stderr->write(__("<error>%s Error:</error> %s\n", $name, $message));
|
||||
|
||||
if (Configure::read('debug') == 0) {
|
||||
App::import('Core', 'CakeLog');
|
||||
|
|
|
@ -75,7 +75,7 @@ class ConsoleInputArgument {
|
|||
$optional = __(' <comment>(optional)</comment>');
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -82,10 +82,10 @@ class ConsoleInputOption {
|
|||
public function help($width = 0) {
|
||||
$default = $short = '';
|
||||
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)) {
|
||||
$default .= sprintf(__(' <comment>(choices: %s)</comment>'), implode('|', $this->_choices));
|
||||
$default .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
|
||||
}
|
||||
if (!empty($this->_short)) {
|
||||
$short = ', -' . $this->_short;
|
||||
|
|
|
@ -458,7 +458,7 @@ class ConsoleOptionParser {
|
|||
foreach ($this->_args as $i => $arg) {
|
||||
if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) {
|
||||
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) {
|
||||
if (!isset($this->_options[$name])) {
|
||||
throw new InvalidArgumentException(sprintf(__('Unknown option `%s`'), $name));
|
||||
throw new InvalidArgumentException(__('Unknown option `%s`', $name));
|
||||
}
|
||||
$option = $this->_options[$name];
|
||||
$isBoolean = $option->isBoolean();
|
||||
|
|
|
@ -78,7 +78,7 @@ class AclShell extends Shell {
|
|||
$out .= __('your core config to reflect your decision to use') . "\n";
|
||||
$out .= __('DbAcl before attempting to use this script') . ".\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";
|
||||
$this->err($out);
|
||||
$this->_stop();
|
||||
|
@ -135,9 +135,9 @@ class AclShell extends Shell {
|
|||
$data['parent_id'] = $parent;
|
||||
$this->Acl->{$class}->create();
|
||||
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 {
|
||||
$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);
|
||||
|
||||
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)) {
|
||||
$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 {
|
||||
$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)) {
|
||||
$this->error(
|
||||
sprintf(__("Supplied Node '%s' not found"), $this->args[1]),
|
||||
__("Supplied Node '%s' not found", $this->args[1]),
|
||||
__('No tree returned.')
|
||||
);
|
||||
}
|
||||
|
@ -230,9 +230,9 @@ class AclShell extends Shell {
|
|||
extract($this->__getParams());
|
||||
|
||||
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 {
|
||||
$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 (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])) {
|
||||
$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:");
|
||||
|
@ -522,7 +522,7 @@ class AclShell extends Shell {
|
|||
$conditions = array($class . '.' . $key => $this->args[1]);
|
||||
$possibility = $this->Acl->{$class}->find('all', compact('conditions'));
|
||||
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;
|
||||
}
|
||||
|
@ -558,7 +558,7 @@ class AclShell extends Shell {
|
|||
if (is_array($identifier)) {
|
||||
$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");
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class ApiShell extends Shell {
|
|||
}
|
||||
|
||||
} else {
|
||||
$this->error(sprintf(__('%s not found'), $class));
|
||||
$this->error(__('%s not found', $class));
|
||||
}
|
||||
|
||||
$parsed = $this->__parseClass($path . $file .'.php', $class);
|
||||
|
@ -95,7 +95,7 @@ class ApiShell extends Shell {
|
|||
if (!empty($parsed)) {
|
||||
if (isset($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();
|
||||
}
|
||||
$method = $parsed[$this->params['method']];
|
||||
|
@ -200,7 +200,7 @@ class ApiShell extends Shell {
|
|||
$parsed = array();
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ class SchemaShell extends Shell {
|
|||
$this->_stop();
|
||||
} else {
|
||||
$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();
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ class SchemaShell extends Shell {
|
|||
}
|
||||
|
||||
if ($this->Schema->write($content)) {
|
||||
$this->out(sprintf(__('Schema file: %s generated'), $content['file']));
|
||||
$this->out(__('Schema file: %s generated', $content['file']));
|
||||
$this->_stop();
|
||||
} else {
|
||||
$this->err(__('Schema file: %s generated'));
|
||||
|
@ -224,7 +224,7 @@ class SchemaShell extends Shell {
|
|||
}
|
||||
|
||||
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();
|
||||
} else {
|
||||
$this->err(__('SQL dump could not be created'));
|
||||
|
@ -283,7 +283,7 @@ class SchemaShell extends Shell {
|
|||
$Schema = $this->Schema->load($options);
|
||||
|
||||
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();
|
||||
}
|
||||
$table = null;
|
||||
|
@ -394,10 +394,10 @@ class SchemaShell extends Shell {
|
|||
|
||||
foreach ($contents as $table => $sql) {
|
||||
if (empty($sql)) {
|
||||
$this->out(sprintf(__('%s is up to date.'), $table));
|
||||
$this->out(__('%s is up to date.', $table));
|
||||
} else {
|
||||
if ($this->__dry === true) {
|
||||
$this->out(sprintf(__('Dry run for %s :'), $table));
|
||||
$this->out(__('Dry run for %s :', $table));
|
||||
$this->out($sql);
|
||||
} else {
|
||||
if (!$Schema->before(array($event => $table))) {
|
||||
|
@ -413,7 +413,7 @@ class SchemaShell extends Shell {
|
|||
if (!empty($error)) {
|
||||
$this->out($error);
|
||||
} else {
|
||||
$this->out(sprintf(__('%s updated.'), $table));
|
||||
$this->out(__('%s updated.', $table));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -558,7 +558,7 @@ class Shell extends Object {
|
|||
* @param string $message An optional error message
|
||||
*/
|
||||
public function error($title, $message = null) {
|
||||
$this->err(sprintf(__('<error>Error:</error> %s'), $title));
|
||||
$this->err(__('<error>Error:</error> %s', $title));
|
||||
|
||||
if (!empty($message)) {
|
||||
$this->err($message);
|
||||
|
@ -594,18 +594,18 @@ class Shell extends Object {
|
|||
$this->out();
|
||||
|
||||
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');
|
||||
|
||||
if (strtolower($key) == 'q') {
|
||||
$this->out(__('<error>Quitting</error>.'), 2);
|
||||
$this->_stop();
|
||||
} elseif (strtolower($key) != 'y') {
|
||||
$this->out(sprintf(__('Skip `%s`'), $path), 2);
|
||||
$this->out(__('Skip `%s`', $path), 2);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->out(sprintf(__('Creating file %s'), $path));
|
||||
$this->out(__('Creating file %s', $path));
|
||||
}
|
||||
|
||||
if (!class_exists('File')) {
|
||||
|
@ -615,10 +615,10 @@ class Shell extends Object {
|
|||
if ($File = new File($path, true)) {
|
||||
$data = $File->prepare($contents);
|
||||
$File->write($data);
|
||||
$this->out(sprintf(__('<success>Wrote</success> `%s`'), $path));
|
||||
$this->out(__('<success>Wrote</success> `%s`', $path));
|
||||
return true;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class ControllerTask extends BakeTask {
|
|||
if (!empty($this->params['admin'])) {
|
||||
$admin = $this->Project->getPrefix();
|
||||
if ($admin) {
|
||||
$this->out(sprintf(__('Adding %s methods'), $admin));
|
||||
$this->out(__('Adding %s methods', $admin));
|
||||
$actions .= "\n" . $this->bakeActions($controller, $admin);
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ class ControllerTask extends BakeTask {
|
|||
protected function _interactive() {
|
||||
$this->interactive = true;
|
||||
$this->hr();
|
||||
$this->out(sprintf(__("Bake Controller\nPath: %s"), $this->path));
|
||||
$this->out(__("Bake Controller\nPath: %s", $this->path));
|
||||
$this->hr();
|
||||
|
||||
if (empty($this->connection)) {
|
||||
|
@ -134,7 +134,7 @@ class ControllerTask extends BakeTask {
|
|||
|
||||
$controllerName = $this->getName();
|
||||
$this->hr();
|
||||
$this->out(sprintf(__('Baking %sController'), $controllerName));
|
||||
$this->out(__('Baking %sController', $controllerName));
|
||||
$this->hr();
|
||||
|
||||
$helpers = $components = array();
|
||||
|
@ -148,7 +148,7 @@ class ControllerTask extends BakeTask {
|
|||
|
||||
$question[] = __("Would you like to build your controller interactively?");
|
||||
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');
|
||||
|
||||
|
@ -213,7 +213,7 @@ class ControllerTask extends BakeTask {
|
|||
$this->hr();
|
||||
$this->out(__('The following controller will be created:'));
|
||||
$this->hr();
|
||||
$this->out(sprintf(__("Controller Name:\n\t%s"), $controllerName));
|
||||
$this->out(__("Controller Name:\n\t%s", $controllerName));
|
||||
|
||||
if (strtolower($useDynamicScaffold) == 'y') {
|
||||
$this->out("var \$scaffold;");
|
||||
|
|
|
@ -114,7 +114,7 @@ class ExtractTask extends Shell {
|
|||
$this->__paths = explode(',', $this->params['paths']);
|
||||
} else {
|
||||
$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) {
|
||||
$response = $this->in($message, null, $defaultPath);
|
||||
if (strtoupper($response) === 'Q') {
|
||||
|
@ -136,7 +136,7 @@ class ExtractTask extends Shell {
|
|||
if (isset($this->params['output'])) {
|
||||
$this->__output = $this->params['output'];
|
||||
} 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) {
|
||||
$response = $this->in($message, null, $this->__paths[0] . DS . 'locale');
|
||||
if (strtoupper($response) === 'Q') {
|
||||
|
@ -156,7 +156,7 @@ class ExtractTask extends Shell {
|
|||
$this->__merge = !(strtolower($this->params['merge']) === 'no');
|
||||
} else {
|
||||
$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';
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ class ExtractTask extends Shell {
|
|||
function __extractTokens() {
|
||||
foreach ($this->__files as $file) {
|
||||
$this->__file = $file;
|
||||
$this->out(sprintf(__('Processing %s...'), $file));
|
||||
$this->out(__('Processing %s...', $file));
|
||||
|
||||
$code = file_get_contents($file);
|
||||
$allTokens = token_get_all($code);
|
||||
|
@ -413,11 +413,11 @@ class ExtractTask extends Shell {
|
|||
$response = '';
|
||||
while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') {
|
||||
$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') {
|
||||
$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);
|
||||
$filename = $response;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ class ExtractTask extends Shell {
|
|||
* @access private
|
||||
*/
|
||||
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;
|
||||
$tokenCount = count($this->__tokens);
|
||||
$parenthesis = 1;
|
||||
|
|
|
@ -166,7 +166,7 @@ class FixtureTask extends BakeTask {
|
|||
$options['records'] = true;
|
||||
}
|
||||
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');
|
||||
if (strtolower($fromTable) == 'y') {
|
||||
$options['fromTable'] = true;
|
||||
|
|
|
@ -112,7 +112,7 @@ class ModelTask extends BakeTask {
|
|||
continue;
|
||||
}
|
||||
$modelClass = Inflector::classify($table);
|
||||
$this->out(sprintf(__('Baking %s'), $modelClass));
|
||||
$this->out(__('Baking %s', $modelClass));
|
||||
$object = $this->_getModelObject($modelClass);
|
||||
if ($this->bake($object, false) && $unitTestExists) {
|
||||
$this->bakeFixture($modelClass);
|
||||
|
@ -190,7 +190,7 @@ class ModelTask extends BakeTask {
|
|||
$primaryKey = $this->findPrimaryKey($fields);
|
||||
}
|
||||
} 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();
|
||||
return false;
|
||||
}
|
||||
|
@ -218,16 +218,16 @@ class ModelTask extends BakeTask {
|
|||
$this->out("Name: " . $currentModelName);
|
||||
|
||||
if ($this->connection !== 'default') {
|
||||
$this->out(sprintf(__("DB Config: %s"), $this->connection));
|
||||
$this->out(__("DB Config: %s", $this->connection));
|
||||
}
|
||||
if ($fullTableName !== Inflector::tableize($currentModelName)) {
|
||||
$this->out(sprintf(__('DB Table: %s'), $fullTableName));
|
||||
$this->out(__('DB Table: %s', $fullTableName));
|
||||
}
|
||||
if ($primaryKey != 'id') {
|
||||
$this->out(sprintf(__('Primary Key: %s'), $primaryKey));
|
||||
$this->out(__('Primary Key: %s', $primaryKey));
|
||||
}
|
||||
if (!empty($validate)) {
|
||||
$this->out(sprintf(__('Validation: %s'), print_r($validate, true)));
|
||||
$this->out(__('Validation: %s', print_r($validate, true)));
|
||||
}
|
||||
if (!empty($associations)) {
|
||||
$this->out(__('Associations:'));
|
||||
|
@ -367,8 +367,8 @@ class ModelTask extends BakeTask {
|
|||
while ($anotherValidator == 'y') {
|
||||
if ($this->interactive) {
|
||||
$this->out();
|
||||
$this->out(sprintf(__('Field: %s'), $fieldName));
|
||||
$this->out(sprintf(__('Type: %s'), $metaData['type']));
|
||||
$this->out(__('Field: %s', $fieldName));
|
||||
$this->out(__('Type: %s', $metaData['type']));
|
||||
$this->hr();
|
||||
$this->out(__('Please select one of the following validation options:'));
|
||||
$this->hr();
|
||||
|
@ -378,7 +378,7 @@ class ModelTask extends BakeTask {
|
|||
for ($i = 1; $i < $defaultChoice; $i++) {
|
||||
$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");
|
||||
|
||||
$methods = array_flip($this->_validations);
|
||||
|
@ -646,7 +646,7 @@ class ModelTask extends BakeTask {
|
|||
$this->hr();
|
||||
|
||||
$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;
|
||||
|
||||
if ($assocType == 0) {
|
||||
|
@ -800,7 +800,7 @@ class ModelTask extends BakeTask {
|
|||
|
||||
if (array_search($useTable, $this->_tables) === false) {
|
||||
$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');
|
||||
}
|
||||
if (strtolower($tableIsGood) == 'n') {
|
||||
|
|
|
@ -56,8 +56,8 @@ class PluginTask extends Shell {
|
|||
$plugin = Inflector::camelize($this->args[0]);
|
||||
$pluginPath = $this->_pluginPath($plugin);
|
||||
if (is_dir($pluginPath)) {
|
||||
$this->out(sprintf(__('Plugin: %s'), $plugin));
|
||||
$this->out(sprintf(__('Path: %s'), $pluginPath));
|
||||
$this->out(__('Plugin: %s', $plugin));
|
||||
$this->out(__('Path: %s', $pluginPath));
|
||||
} else {
|
||||
$this->_interactive($plugin);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ class PluginTask extends Shell {
|
|||
}
|
||||
|
||||
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->hr();
|
||||
$this->out(sprintf(__("<info>Plugin Name:</info> %s"), $plugin));
|
||||
$this->out(sprintf(__("<info>Plugin Directory:</info> %s"), $this->path . $pluginPath));
|
||||
$this->out(__("<info>Plugin Name:</info> %s", $plugin));
|
||||
$this->out(__("<info>Plugin Directory:</info> %s", $this->path . $pluginPath));
|
||||
$this->hr();
|
||||
|
||||
$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->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;
|
||||
|
|
|
@ -68,7 +68,7 @@ class ProjectTask extends Shell {
|
|||
if ($project) {
|
||||
$response = false;
|
||||
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');
|
||||
if (strtolower($response) === 'n') {
|
||||
$response = $project = false;
|
||||
|
@ -89,23 +89,23 @@ class ProjectTask extends Shell {
|
|||
if ($this->securitySalt($path) === true) {
|
||||
$this->out(__(' * Random hash key created for \'Security.salt\''));
|
||||
} 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;
|
||||
}
|
||||
|
||||
if ($this->securityCipherSeed($path) === true) {
|
||||
$this->out(__(' * Random seed created for \'Security.cipherSeed\''));
|
||||
} 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;
|
||||
}
|
||||
|
||||
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(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/index.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>'));
|
||||
} 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;
|
||||
}
|
||||
if ($this->consolePath($path) === true) {
|
||||
|
@ -117,8 +117,8 @@ class ProjectTask extends Shell {
|
|||
|
||||
$Folder = new Folder($path);
|
||||
if (!$Folder->chmod($path . 'tmp', 0777)) {
|
||||
$this->err(sprintf(__('Could not set permissions on %s'), $path . DS .'tmp'));
|
||||
$this->out(sprintf(__('chmod -R 0777 %s'), $path . DS .'tmp'));
|
||||
$this->err(__('Could not set permissions on %s', $path . DS .'tmp'));
|
||||
$this->out(__('chmod -R 0777 %s', $path . DS .'tmp'));
|
||||
$success = false;
|
||||
}
|
||||
if ($success) {
|
||||
|
@ -146,7 +146,7 @@ class ProjectTask extends Shell {
|
|||
$skel = $this->params['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 == '') {
|
||||
$this->err(__('The directory path you supplied was empty. Please try again.'));
|
||||
} else {
|
||||
|
@ -172,10 +172,10 @@ class ProjectTask extends Shell {
|
|||
|
||||
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
|
||||
$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();
|
||||
} else {
|
||||
$this->err(sprintf(__("<error>Could not create</error> '%s' properly."), $app));
|
||||
$this->err(__("<error>Could not create</error> '%s' properly.", $app));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ class TemplateTask extends Shell {
|
|||
return $templatePath;
|
||||
}
|
||||
}
|
||||
$this->err(sprintf(__('Could not find template for %s'), $filename));
|
||||
$this->err(__('Could not find template for %s', $filename));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,13 +92,13 @@ class TestTask extends BakeTask {
|
|||
$this->interactive = true;
|
||||
$this->hr();
|
||||
$this->out(__('Bake Tests'));
|
||||
$this->out(sprintf(__('Path: %s'), $this->path));
|
||||
$this->out(__('Path: %s', $this->path));
|
||||
$this->hr();
|
||||
|
||||
if ($type) {
|
||||
$type = Inflector::camelize($type);
|
||||
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 {
|
||||
$type = $this->getObjectType();
|
||||
|
@ -180,7 +180,7 @@ class TestTask extends BakeTask {
|
|||
*/
|
||||
public function getClassName($objectType) {
|
||||
$options = App::objects(strtolower($objectType));
|
||||
$this->out(sprintf(__('Choose a %s class'), $objectType));
|
||||
$this->out(__('Choose a %s class', $objectType));
|
||||
$keys = array();
|
||||
foreach ($options as $key => $option) {
|
||||
$this->out(++$key . '. ' . $option);
|
||||
|
|
|
@ -221,7 +221,7 @@ class ViewTask extends BakeTask {
|
|||
|
||||
$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');
|
||||
|
||||
if (strtolower($interactive) == 'n') {
|
||||
|
@ -278,7 +278,7 @@ class ViewTask extends BakeTask {
|
|||
|
||||
if (!App::import('Controller', $import)) {
|
||||
$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();
|
||||
}
|
||||
$controllerClassName = $this->controllerName . 'Controller';
|
||||
|
@ -339,9 +339,9 @@ class ViewTask extends BakeTask {
|
|||
$this->hr();
|
||||
$this->out(__('The following view will be created:'));
|
||||
$this->hr();
|
||||
$this->out(sprintf(__('Controller Name: %s'), $this->controllerName));
|
||||
$this->out(sprintf(__('Action Name: %s'), $action));
|
||||
$this->out(sprintf(__('Path: %s'), $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"));
|
||||
$this->out(__('Controller Name: %s', $this->controllerName));
|
||||
$this->out(__('Action Name: %s', $action));
|
||||
$this->out(__('Path: %s', $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"));
|
||||
$this->hr();
|
||||
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
|
||||
if (strtolower($looksGood) == 'y') {
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
$this->Session->setFlash(__('Invalid <?php echo strtolower($singularHumanName); ?>'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
<?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; ?>
|
||||
}
|
||||
if ($this->request->is('post')) {
|
||||
|
@ -123,7 +123,7 @@
|
|||
$this->Session->setFlash(__('Invalid id for <?php echo strtolower($singularHumanName); ?>'));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
<?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; ?>
|
||||
}
|
||||
if ($this-><?php echo $currentModelName; ?>->delete($id)) {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<ul>
|
||||
|
||||
<?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;?>
|
||||
<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?></li>
|
||||
<?php
|
||||
|
|
|
@ -24,7 +24,7 @@ endif;
|
|||
\$settings = Cache::settings();
|
||||
if (!empty(\$settings)):
|
||||
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>';
|
||||
else:
|
||||
echo '<span class=\"notice\">';
|
||||
|
@ -75,9 +75,9 @@ $output .= "<?php endif;?>\n";
|
|||
$output .= "<h3><?php echo __('Editing this Page') ?></h3>\n";
|
||||
$output .= "<p>\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\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 .= "?>\n";
|
||||
$output .= "</p>\n";
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
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(__('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</tr>\n";
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ foreach ($fields as $field) {
|
|||
<ul>
|
||||
<?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->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(__('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\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->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</tr>\n";
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ class Cache {
|
|||
self::set(null, $config);
|
||||
if ($success === false && $value !== '') {
|
||||
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
|
||||
);
|
||||
}
|
||||
|
|
2
cake/libs/cache/file.php
vendored
2
cake/libs/cache/file.php
vendored
|
@ -298,7 +298,7 @@ class FileEngine extends CacheEngine {
|
|||
$dir = new SplFileInfo($this->settings['path']);
|
||||
if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
|
||||
$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 true;
|
||||
|
|
4
cake/libs/cache/memcache.php
vendored
4
cake/libs/cache/memcache.php
vendored
|
@ -153,7 +153,7 @@ class MemcacheEngine extends CacheEngine {
|
|||
public function increment($key, $offset = 1) {
|
||||
if ($this->settings['compress']) {
|
||||
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);
|
||||
|
@ -171,7 +171,7 @@ class MemcacheEngine extends CacheEngine {
|
|||
public function decrement($key, $offset = 1) {
|
||||
if ($this->settings['compress']) {
|
||||
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);
|
||||
|
|
|
@ -134,7 +134,7 @@ class CakeLog {
|
|||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -262,12 +262,12 @@ class CakeSession {
|
|||
public static function delete($name) {
|
||||
if (self::check($name)) {
|
||||
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));
|
||||
return (self::check($name) == false);
|
||||
}
|
||||
self::__setError(2, sprintf(__("%s doesn't exist"), $name));
|
||||
self::__setError(2, __("%s doesn't exist", $name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -452,7 +452,7 @@ class CakeSession {
|
|||
}
|
||||
foreach ($write as $key => $val) {
|
||||
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));
|
||||
if (Set::classicExtract($_SESSION, $key) !== $val) {
|
||||
|
@ -562,7 +562,7 @@ class CakeSession {
|
|||
App::import('Core', 'session/' . $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();
|
||||
if ($handler instanceof CakeSessionHandlerInterface) {
|
||||
|
|
|
@ -147,7 +147,7 @@ class ClassRegistry {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ class Configure {
|
|||
self::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR, 'www_root' => WWW_ROOT));
|
||||
|
||||
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) {
|
||||
|
@ -100,7 +100,7 @@ class Configure {
|
|||
App::init();
|
||||
App::build();
|
||||
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;
|
||||
if (isset(self::$_values['Error']['level'])) {
|
||||
|
@ -299,7 +299,7 @@ class Configure {
|
|||
}
|
||||
|
||||
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 self::write($config);
|
||||
|
|
|
@ -68,7 +68,7 @@ class AclComponent extends Component {
|
|||
list($plugin, $name) = pluginSplit($name);
|
||||
$name .= 'Component';
|
||||
} else {
|
||||
throw new Exception(sprintf(__('Could not find %s.'), $name));
|
||||
throw new Exception(__('Could not find %s.', $name));
|
||||
}
|
||||
}
|
||||
$this->adapter($name);
|
||||
|
@ -316,7 +316,7 @@ class DbAcl extends Object implements AclInterface {
|
|||
$acoNode = $acoPath[0];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ class AuthComponent extends Component {
|
|||
case 'crud':
|
||||
if (!isset($this->actionMap[$this->request['action']])) {
|
||||
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
|
||||
);
|
||||
} else {
|
||||
|
@ -547,13 +547,13 @@ class AuthComponent extends Component {
|
|||
$action = $this->action(':action');
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (method_exists($object, 'isAuthorized')) {
|
||||
$valid = $object->isAuthorized($user, $this->action(':controller'), $action);
|
||||
} 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;
|
||||
case null:
|
||||
|
|
|
@ -174,7 +174,7 @@ class CakeException extends RuntimeException {
|
|||
public function __construct($message, $code = 500) {
|
||||
if (is_array($message)) {
|
||||
$this->_attributes = $message;
|
||||
$message = vsprintf(__($this->_messageTemplate), $message);
|
||||
$message = __($this->_messageTemplate, $message);
|
||||
}
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
|
|
@ -359,11 +359,11 @@ class Folder {
|
|||
|
||||
if ($recursive === false && is_dir($path)) {
|
||||
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;
|
||||
}
|
||||
|
||||
$this->__errors[] = sprintf(__('%s NOT changed to %s'), $path, $mode);
|
||||
$this->__errors[] = __('%s NOT changed to %s', $path, $mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -380,9 +380,9 @@ class Folder {
|
|||
}
|
||||
|
||||
if (@chmod($fullpath, intval($mode, 8))) {
|
||||
$this->__messages[] = sprintf(__('%s changed to %s'), $fullpath, $mode);
|
||||
$this->__messages[] = __('%s changed to %s', $fullpath, $mode);
|
||||
} 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)) {
|
||||
$this->__errors[] = sprintf(__('%s is a file'), $pathname);
|
||||
$this->__errors[] = __('%s is a file', $pathname);
|
||||
return false;
|
||||
}
|
||||
$pathname = rtrim($pathname, DS);
|
||||
|
@ -478,11 +478,11 @@ class Folder {
|
|||
$old = umask(0);
|
||||
if (mkdir($pathname, $mode)) {
|
||||
umask($old);
|
||||
$this->__messages[] = sprintf(__('%s created'), $pathname);
|
||||
$this->__messages[] = __('%s created', $pathname);
|
||||
return true;
|
||||
} else {
|
||||
umask($old);
|
||||
$this->__errors[] = sprintf(__('%s NOT created'), $pathname);
|
||||
$this->__errors[] = __('%s NOT created', $pathname);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -555,9 +555,9 @@ class Folder {
|
|||
}
|
||||
if (is_file($file) === true) {
|
||||
if (@unlink($file)) {
|
||||
$this->__messages[] = sprintf(__('%s removed'), $file);
|
||||
$this->__messages[] = __('%s removed', $file);
|
||||
} else {
|
||||
$this->__errors[] = sprintf(__('%s NOT removed'), $file);
|
||||
$this->__errors[] = __('%s NOT removed', $file);
|
||||
}
|
||||
} elseif (is_dir($file) === true && $this->delete($file) === false) {
|
||||
return false;
|
||||
|
@ -566,10 +566,10 @@ class Folder {
|
|||
}
|
||||
$path = substr($path, 0, strlen($path) - 1);
|
||||
if (rmdir($path) === false) {
|
||||
$this->__errors[] = sprintf(__('%s NOT removed'), $path);
|
||||
$this->__errors[] = __('%s NOT removed', $path);
|
||||
return false;
|
||||
} else {
|
||||
$this->__messages[] = sprintf(__('%s removed'), $path);
|
||||
$this->__messages[] = __('%s removed', $path);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -604,7 +604,7 @@ class Folder {
|
|||
$mode = $options['mode'];
|
||||
|
||||
if (!$this->cd($fromDir)) {
|
||||
$this->__errors[] = sprintf(__('%s not found'), $fromDir);
|
||||
$this->__errors[] = __('%s not found', $fromDir);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -613,7 +613,7 @@ class Folder {
|
|||
}
|
||||
|
||||
if (!is_writable($toDir)) {
|
||||
$this->__errors[] = sprintf(__('%s not writable'), $toDir);
|
||||
$this->__errors[] = __('%s not writable', $toDir);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -627,9 +627,9 @@ class Folder {
|
|||
if (copy($from, $to)) {
|
||||
chmod($to, intval($mode, 8));
|
||||
touch($to, filemtime($from));
|
||||
$this->__messages[] = sprintf(__('%s copied to %s'), $from, $to);
|
||||
$this->__messages[] = __('%s copied to %s', $from, $to);
|
||||
} 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);
|
||||
chmod($to, $mode);
|
||||
umask($old);
|
||||
$this->__messages[] = sprintf(__('%s created'), $to);
|
||||
$this->__messages[] = __('%s created', $to);
|
||||
$options = array_merge($options, array('to'=> $to, 'from'=> $from));
|
||||
$this->copy($options);
|
||||
} else {
|
||||
$this->__errors[] = sprintf(__('%s not created'), $to);
|
||||
$this->__errors[] = __('%s not created', $to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -528,7 +528,7 @@ class HttpSocket extends CakeSocket {
|
|||
|
||||
if (!is_callable(array(&$this, $decodeMethod))) {
|
||||
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);
|
||||
}
|
||||
|
@ -825,7 +825,7 @@ class HttpSocket extends CakeSocket {
|
|||
$request['uri'] = $this->_buildUri($request['uri'], '/%path?%query');
|
||||
|
||||
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 $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak;
|
||||
|
|
|
@ -203,7 +203,7 @@ class BehaviorCollection extends ObjectCollection {
|
|||
$call = null;
|
||||
|
||||
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;
|
||||
} elseif ($found) {
|
||||
$methods = array_combine($methods, array_values($this->__methods));
|
||||
|
|
|
@ -56,7 +56,7 @@ class AclBehavior extends ModelBehavior {
|
|||
}
|
||||
$model->{$type} = ClassRegistry::init($type);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ class ContainableBehavior extends ModelBehavior {
|
|||
|
||||
if (!isset($Model->{$name}) || !is_object($Model->{$name})) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
$db = ConnectionManager::getDataSource($model->useDbConfig);
|
||||
if (!$db->connected) {
|
||||
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
|
||||
);
|
||||
return false;
|
||||
|
@ -439,7 +439,7 @@ class TranslateBehavior extends ModelBehavior {
|
|||
foreach (array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany') as $type) {
|
||||
if (isset($model->{$type}[$association]) || isset($model->__backAssociation[$type][$association])) {
|
||||
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
|
||||
);
|
||||
return false;
|
||||
|
|
|
@ -587,7 +587,7 @@ class CakeSchema extends Object {
|
|||
$value['key'] = 'primary';
|
||||
}
|
||||
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;
|
||||
} else {
|
||||
$defaultCol = $db->columns[$value['type']];
|
||||
|
|
|
@ -95,7 +95,7 @@ class ConnectionManager {
|
|||
}
|
||||
|
||||
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;
|
||||
return $null;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ class ConnectionManager {
|
|||
$class = $conn['classname'];
|
||||
|
||||
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;
|
||||
return $null;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ class ConnectionManager {
|
|||
$class = "{$conn['plugin']}.{$conn['classname']}";
|
||||
|
||||
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 true;
|
||||
|
|
|
@ -978,7 +978,7 @@ class DboOracle extends DboSource {
|
|||
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
|
||||
if (!isset($resultSet) || !is_array($resultSet)) {
|
||||
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) {
|
||||
echo $this->error;
|
||||
}
|
||||
|
|
|
@ -493,7 +493,7 @@ class DboSqlite extends DboSource {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -662,7 +662,7 @@ class DboSource extends DataSource {
|
|||
if ($error) {
|
||||
trigger_error('<span style="color:Red;text-align:left"><b>' . __('SQL Error:') . "</b> {$this->error}</span>", E_USER_WARNING);
|
||||
} 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));
|
||||
}
|
||||
|
@ -897,7 +897,7 @@ class DboSource extends DataSource {
|
|||
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
|
||||
if (!isset($resultSet) || !is_array($resultSet)) {
|
||||
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) {
|
||||
echo $this->error;
|
||||
}
|
||||
|
@ -2666,7 +2666,7 @@ class DboSource extends DataSource {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ class AclNode extends AppModel {
|
|||
$model = ClassRegistry::init(array('class' => $name, 'alias' => $name));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ class AclNode extends AppModel {
|
|||
$result = $db->read($this, $queryData, -1);
|
||||
|
||||
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;
|
||||
|
|
|
@ -2638,7 +2638,7 @@ class Model extends Object {
|
|||
} elseif (!is_array($validator['rule'])) {
|
||||
$valid = preg_match($rule, $data[$fieldName]);
|
||||
} 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)) {
|
||||
|
@ -2947,7 +2947,7 @@ class Model extends Object {
|
|||
return array($with, array_unique(array_merge($assoc[$with], $keys)));
|
||||
}
|
||||
trigger_error(
|
||||
sprintf(__('Invalid join model settings in %s'), $model->alias),
|
||||
__('Invalid join model settings in %s', $model->alias),
|
||||
E_USER_WARNING
|
||||
);
|
||||
}
|
||||
|
|
|
@ -714,11 +714,11 @@ class Validation {
|
|||
protected static function _pass($method, $check, $classPrefix) {
|
||||
$className = ucwords($classPrefix) . 'Validation';
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
$check = (array)$check;
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
* @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">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -40,6 +40,6 @@ class <?php echo $controller;?> extends AppController {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Behavior Class'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends ModelBehavior {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Behavior File'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends ModelBehavior {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Component Class'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends Component {<br />
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -24,7 +24,7 @@
|
|||
</p>
|
||||
<p class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends Component {<br />
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,15 +20,15 @@
|
|||
<h2><?php echo __('Missing Database Connection'); ?></h2>
|
||||
<p class="error">
|
||||
<strong><?php echo __('Error'); ?>: </strong>
|
||||
<?php printf(__('%s requires a database connection'), $class); ?>
|
||||
<?php echo __('%s requires a database connection', $class); ?>
|
||||
</p>
|
||||
<p class="error">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Controller'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $controller;?> extends AppController {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
</p>
|
||||
<p class="error">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Helper Class'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends AppHelper {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Helper File'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
@ -35,7 +35,7 @@ class <?php echo $class;?> extends AppHelper {
|
|||
</pre>
|
||||
<p class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,15 +20,15 @@
|
|||
<h2><?php echo __('Missing Layout'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,11 +20,11 @@
|
|||
<h2><?php echo __('Missing Database Table'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -20,15 +20,15 @@
|
|||
<h2><?php echo __('Missing View'); ?></h2>
|
||||
<p class="error">
|
||||
<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 class="error">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -17,14 +17,14 @@
|
|||
* @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">
|
||||
<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 class="notice">
|
||||
<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>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
|
@ -24,7 +24,7 @@
|
|||
</p>
|
||||
<p class="notice">
|
||||
<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>
|
||||
<pre>
|
||||
<?php
|
||||
|
|
|
@ -129,7 +129,7 @@ class Helper extends Object {
|
|||
* @param array $params Array of params for the method.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -505,7 +505,7 @@ class FormHelper extends AppHelper {
|
|||
if ($text != null) {
|
||||
$error = $text;
|
||||
} 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']) {
|
||||
$error = h($error);
|
||||
|
@ -1140,7 +1140,7 @@ class FormHelper extends AppHelper {
|
|||
public function __call($method, $params) {
|
||||
$options = array();
|
||||
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])) {
|
||||
$options = $params[1];
|
||||
|
|
|
@ -152,7 +152,7 @@ class JsHelper extends AppHelper {
|
|||
if (method_exists($this, $method . '_')) {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,15 +88,15 @@ class NumberHelper extends AppHelper {
|
|||
public function toReadableSize($size) {
|
||||
switch (true) {
|
||||
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:
|
||||
return sprintf(__('%d KB'), $this->precision($size / 1024, 0));
|
||||
return __('%d KB', $this->precision($size / 1024, 0));
|
||||
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:
|
||||
return sprintf(__('%.2f GB'), $this->precision($size / 1024 / 1024 / 1024, 2));
|
||||
return __('%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2));
|
||||
default:
|
||||
return sprintf(__('%.2f TB'), $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
|
||||
return __('%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -224,9 +224,9 @@ class TimeHelper extends AppHelper {
|
|||
$y = $this->isThisYear($date) ? '' : ' %Y';
|
||||
|
||||
if ($this->isToday($date)) {
|
||||
$ret = sprintf(__('Today, %s'), strftime("%H:%M", $date));
|
||||
$ret = __('Today, %s', strftime("%H:%M", $date));
|
||||
} elseif ($this->wasYesterday($date)) {
|
||||
$ret = sprintf(__('Yesterday, %s'), strftime("%H:%M", $date));
|
||||
$ret = __('Yesterday, %s', strftime("%H:%M", $date));
|
||||
} else {
|
||||
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
|
||||
$ret = strftime($format, $date);
|
||||
|
@ -572,7 +572,7 @@ class TimeHelper extends AppHelper {
|
|||
$diff = $futureTime - $pastTime;
|
||||
|
||||
if ($diff > abs($now - $this->fromString($end))) {
|
||||
$relativeDate = sprintf(__('on %s'), date($format, $inSeconds));
|
||||
$relativeDate = __('on %s', date($format, $inSeconds));
|
||||
} else {
|
||||
if ($years > 0) {
|
||||
// years and months and days
|
||||
|
@ -606,7 +606,7 @@ class TimeHelper extends AppHelper {
|
|||
}
|
||||
|
||||
if (!$backwards) {
|
||||
$relativeDate = sprintf(__('%s ago'), $relativeDate);
|
||||
$relativeDate = __('%s ago', $relativeDate);
|
||||
}
|
||||
}
|
||||
return $relativeDate;
|
||||
|
|
|
@ -20,7 +20,7 @@ if (Configure::read() == 0):
|
|||
$this->cakeError('error404');
|
||||
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>
|
||||
<?php
|
||||
if (Configure::read() > 0):
|
||||
|
@ -45,7 +45,7 @@ endif;
|
|||
$settings = Cache::settings();
|
||||
if (!empty($settings)):
|
||||
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>';
|
||||
else:
|
||||
echo '<span class="notice">';
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
foreach ($associations as $_type => $_data) {
|
||||
foreach ($_data as $_alias => $_details) {
|
||||
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(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</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(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
|
||||
$done[] = $_details['controller'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,14 +76,14 @@ echo "\n";
|
|||
<div class="actions">
|
||||
<h3><?php echo __('Actions'); ?></h3>
|
||||
<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
|
||||
$done = array();
|
||||
foreach ($associations as $_type => $_data) {
|
||||
foreach ($_data as $_alias => $_details) {
|
||||
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(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</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(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
|
||||
$done[] = $_details['controller'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
?>
|
||||
<div class="<?php echo $pluralVar;?> view">
|
||||
<h2><?php printf(__('View %s'), $singularHumanName); ?></h2>
|
||||
<h2><?php echo __('View %s', $singularHumanName); ?></h2>
|
||||
<dl>
|
||||
<?php
|
||||
$i = 0;
|
||||
|
@ -50,17 +50,17 @@ foreach ($scaffoldFields as $_field) {
|
|||
<h3><?php echo __('Actions'); ?></h3>
|
||||
<ul>
|
||||
<?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(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(sprintf(__('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(__('Edit %s', $singularHumanName), array('action' => 'edit', ${$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(__('List %s', $pluralHumanName), array('action' => 'index')). " </li>\n";
|
||||
echo "\t\t<li>" .$this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')). " </li>\n";
|
||||
|
||||
$done = array();
|
||||
foreach ($associations as $_type => $_data) {
|
||||
foreach ($_data as $_alias => $_details) {
|
||||
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(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</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(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
|
||||
$done[] = $_details['controller'];
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ foreach ($scaffoldFields as $_field) {
|
|||
if (!empty($associations['hasOne'])) :
|
||||
foreach ($associations['hasOne'] as $_alias => $_details): ?>
|
||||
<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])):?>
|
||||
<dl>
|
||||
<?php
|
||||
|
@ -91,7 +91,7 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
|
|||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -111,7 +111,7 @@ foreach ($relations as $_alias => $_details):
|
|||
$otherSingularVar = Inflector::variable($_alias);
|
||||
?>
|
||||
<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])):?>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -152,7 +152,7 @@ $otherSingularVar = Inflector::variable($_alias);
|
|||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -409,7 +409,7 @@ class View extends Object {
|
|||
$layout = $this->layout;
|
||||
}
|
||||
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) {
|
||||
$this->output = $this->renderLayout($this->output, $layout);
|
||||
|
@ -451,7 +451,7 @@ class View extends Object {
|
|||
$this->output = $this->_render($layoutFileName);
|
||||
|
||||
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));
|
||||
|
|
|
@ -367,6 +367,30 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __('Plural Rule 1 (from core)');
|
||||
$expected = 'Plural Rule 1 (from core translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Some string with %s', 'arguments');
|
||||
$expected = 'Some string with arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Some string with %s %s', 'multiple', 'arguments');
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Some string with %s %s', array('multiple', 'arguments'));
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Testing %2$s %1$s', 'order', 'different');
|
||||
$expected = 'Testing different order';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Testing %2$s %1$s', array('order', 'different'));
|
||||
$expected = 'Testing different order';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __('Testing %.2f number', 1.2345);
|
||||
$expected = 'Testing 1.23 number';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -388,6 +412,18 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __n('%d = 1 (from core)', '%d = 0 or > 1 (from core)', 2);
|
||||
$expected = '%d = 0 or > 1 (from core translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __n('%d item.', '%d items.', 1, 1);
|
||||
$expected = '1 item.';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __n('%d item for id %s', '%d items for id %s', 2, 2, '1234');
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __n('%d item for id %s', '%d items for id %s', 2, array(2, '1234'));
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -409,6 +445,18 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __d('core', 'Plural Rule 1 (from core)');
|
||||
$expected = 'Plural Rule 1 (from core translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __d('core', 'Some string with %s', 'arguments');
|
||||
$expected = 'Some string with arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __d('core', 'Some string with %s %s', 'multiple', 'arguments');
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __d('core', 'Some string with %s %s', array('multiple', 'arguments'));
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -435,6 +483,17 @@ class BasicsTest extends CakeTestCase {
|
|||
$expected = '%d = 1 (translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dn('core', '%d item.', '%d items.', 1, 1);
|
||||
$expected = '1 item.';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dn('core', '%d item for id %s', '%d items for id %s', 2, 2, '1234');
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dn('core', '%d item for id %s', '%d items for id %s', 2, array(2, '1234'));
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -452,6 +511,18 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __c('Plural Rule 1 (from core)', 6);
|
||||
$expected = 'Plural Rule 1 (from core translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __c('Some string with %s', 6, 'arguments');
|
||||
$expected = 'Some string with arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __c('Some string with %s %s', 6, 'multiple', 'arguments');
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __c('Some string with %s %s', 6, array('multiple', 'arguments'));
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -477,6 +548,18 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __dc('core', 'Plural Rule 1 (from core)', 6);
|
||||
$expected = 'Plural Rule 1 (from core translated)';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dc('core', 'Some string with %s', 6, 'arguments');
|
||||
$expected = 'Some string with arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dc('core', 'Some string with %s %s', 6, 'multiple', 'arguments');
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dc('core', 'Some string with %s %s', 6, array('multiple', 'arguments'));
|
||||
$expected = 'Some string with multiple arguments';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -498,6 +581,18 @@ class BasicsTest extends CakeTestCase {
|
|||
$result = __dcn('core', '%d = 1', '%d = 0 or > 1', 0, 6);
|
||||
$expected = '%d = 0 or > 1';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dcn('core', '%d item.', '%d items.', 1, 6, 1);
|
||||
$expected = '1 item.';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dcn('core', '%d item for id %s', '%d items for id %s', 2, 6, 2, '1234');
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
|
||||
$result = __dcn('core', '%d item for id %s', '%d items for id %s', 2, 6, array(2, '1234'));
|
||||
$expected = '2 items for id 1234';
|
||||
$this->assertEqual($result, $expected);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -484,8 +484,7 @@ class FileTest extends CakeTestCase {
|
|||
$assertLine = $assertLine->traceMethod();
|
||||
$shortPath = substr($tmpFile, strlen(ROOT));
|
||||
|
||||
$message = '[FileTest] Skipping %s because "%s" not writeable!';
|
||||
$message = sprintf(__($message), $caller, $shortPath).$assertLine;
|
||||
$message = __('[FileTest] Skipping %s because "%s" not writeable!', $caller, $shortPath).$assertLine;
|
||||
$this->_reporter->paintSkip($message);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -251,7 +251,7 @@ class CakeFixtureManager {
|
|||
$fixture->truncate($db);
|
||||
$fixture->insert($db);
|
||||
} else {
|
||||
throw new UnexpectedValueException(sprintf(__('Referenced fixture class %s not found'), $name));
|
||||
throw new UnexpectedValueException(__('Referenced fixture class %s not found', $name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ class CakeBaseReporter implements PHPUnit_Framework_TestListener {
|
|||
* @param PHPUnit_Framework_TestSuite $suite
|
||||
*/
|
||||
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
|
||||
echo sprintf(__('Running %s'), $suite->getName()) . "\n";
|
||||
echo __('Running %s', $suite->getName()) . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -237,7 +237,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
echo "<li class='fail'>\n";
|
||||
echo "<span>Failed</span>";
|
||||
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 "</li>\n";
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
echo "<span>Exception</span>";
|
||||
|
||||
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 "</li>\n";
|
||||
}
|
||||
|
@ -341,6 +341,6 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
* @param 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>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,10 +152,10 @@ class TestManager {
|
|||
$testCaseFileWithPath = $this->_getTestsPath($this->params) . DS . $testCaseFile;
|
||||
|
||||
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) {
|
||||
$suite = $this->getTestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile));
|
||||
$suite = $this->getTestSuite(__('Individual test case: %s', $testCaseFile));
|
||||
}
|
||||
$suite->addTestFile($testCaseFileWithPath);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
$settings = array();
|
||||
if (!empty($settings)):
|
||||
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>';
|
||||
else:
|
||||
echo '<span class="notice">';
|
||||
|
@ -66,9 +66,9 @@ if (!empty($filePresent)):
|
|||
<h3><?php echo __('Editing this Page') ?></h3>
|
||||
<p>
|
||||
<?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
|
||||
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');
|
||||
?>
|
||||
</p>
|
|
@ -96,7 +96,7 @@ if (!empty($filePresent)):
|
|||
</span>
|
||||
</p>
|
||||
<?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>
|
||||
<h2><?php __('Editing this Page'); ?></h2>
|
||||
<p>
|
||||
|
|
Loading…
Reference in a new issue