From f4d4811c96a6468f9a175a893b060debbd1af149 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sat, 4 Dec 2010 20:19:17 -0200 Subject: [PATCH 1/3] Fixed wrong documentation. --- cake/basics.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index ca935acde..fa6fbada6 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -461,8 +461,7 @@ 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 + * @return mixed translated string * @link http://book.cakephp.org/view/1121/__ */ function __($singular) { @@ -482,8 +481,7 @@ 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 + * @return mixed plural form of translated string */ function __n($singular, $plural, $count) { if (!$singular) { @@ -500,8 +498,7 @@ 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 + * @return translated string */ function __d($domain, $msg) { if (!$msg) { @@ -522,8 +519,7 @@ 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 + * @return plural form of translated string */ function __dn($domain, $singular, $plural, $count) { if (!$singular) { @@ -555,8 +551,7 @@ 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 + * @return translated string */ function __dc($domain, $msg, $category) { if (!$msg) { @@ -592,8 +587,7 @@ 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 + * @return plural form of translated string */ function __dcn($domain, $singular, $plural, $count, $category) { if (!$singular) { @@ -621,8 +615,7 @@ 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 + * @return translated string */ function __c($msg, $category) { if (!$msg) { From 30661ed154835bb14f1eb77af8421a5e29bd70e9 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sat, 4 Dec 2010 23:34:59 -0200 Subject: [PATCH 2/3] Support to vsprintf in i18n aliases (__*() functions). --- cake/basics.php | 77 +++++++++++++++++++++----- cake/tests/cases/basics.test.php | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 14 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index fa6fbada6..cba8c4eae 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -461,17 +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 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); } /** @@ -481,16 +488,23 @@ if (!function_exists('sortByKey')) { * @param string $singular Singular text to translate * @param string $plural Plural text * @param integer $count Count + * @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); } /** @@ -498,16 +512,23 @@ if (!function_exists('sortByKey')) { * * @param string $domain Domain * @param string $msg String to translate + * @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); } /** @@ -519,16 +540,23 @@ if (!function_exists('sortByKey')) { * @param string $singular Singular string to translate * @param string $plural Plural * @param integer $count Count + * @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); } /** @@ -551,16 +579,23 @@ if (!function_exists('sortByKey')) { * @param string $domain Domain * @param string $msg Message to translate * @param integer $category Category + * @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); } /** @@ -587,16 +622,23 @@ if (!function_exists('sortByKey')) { * @param string $plural Plural * @param integer $count Count * @param integer $category Category + * @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); } /** @@ -615,16 +657,23 @@ if (!function_exists('sortByKey')) { * * @param string $msg String to translate * @param integer $category Category + * @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); } /** diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 6972e0315..f6051717b 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -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); } /** From c52d5320c8308e4fe6aac666381629dd16215b57 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sat, 4 Dec 2010 23:37:13 -0200 Subject: [PATCH 3/3] Replaced the *printf with i18n aliases by i18n aliases with params. --- cake/console/libs/console_error_handler.php | 4 +-- cake/console/libs/console_input_argument.php | 2 +- cake/console/libs/console_input_option.php | 4 +-- cake/console/libs/console_option_parser.php | 4 +-- cake/console/shells/acl.php | 26 +++++++------- cake/console/shells/api.php | 6 ++-- cake/console/shells/schema.php | 14 ++++---- cake/console/shells/shell.php | 12 +++---- cake/console/shells/tasks/controller.php | 10 +++--- cake/console/shells/tasks/extract.php | 14 ++++---- cake/console/shells/tasks/fixture.php | 2 +- cake/console/shells/tasks/model.php | 22 ++++++------ cake/console/shells/tasks/plugin.php | 12 +++---- cake/console/shells/tasks/project.php | 22 ++++++------ cake/console/shells/tasks/template.php | 2 +- cake/console/shells/tasks/test.php | 6 ++-- cake/console/shells/tasks/view.php | 10 +++--- .../default/actions/controller_actions.ctp | 4 +-- cake/console/templates/default/views/form.ctp | 2 +- cake/console/templates/default/views/home.ctp | 6 ++-- .../console/templates/default/views/index.ctp | 2 +- cake/console/templates/default/views/view.ctp | 4 +-- cake/libs/cache.php | 2 +- cake/libs/cache/file.php | 2 +- cake/libs/cache/memcache.php | 4 +-- cake/libs/cake_log.php | 2 +- cake/libs/cake_session.php | 8 ++--- cake/libs/class_registry.php | 2 +- cake/libs/configure.php | 6 ++-- cake/libs/controller/components/acl.php | 4 +-- cake/libs/controller/components/auth.php | 6 ++-- cake/libs/error/exceptions.php | 2 +- cake/libs/folder.php | 34 +++++++++---------- cake/libs/http_socket.php | 4 +-- cake/libs/model/behavior_collection.php | 2 +- cake/libs/model/behaviors/acl.php | 2 +- cake/libs/model/behaviors/containable.php | 2 +- cake/libs/model/behaviors/translate.php | 4 +-- cake/libs/model/cake_schema.php | 2 +- cake/libs/model/connection_manager.php | 6 ++-- .../libs/model/datasources/dbo/dbo_oracle.php | 2 +- .../libs/model/datasources/dbo/dbo_sqlite.php | 2 +- cake/libs/model/datasources/dbo_source.php | 6 ++-- cake/libs/model/db_acl.php | 4 +-- cake/libs/model/model.php | 4 +-- cake/libs/validation.php | 4 +-- cake/libs/view/errors/missing_action.ctp | 8 ++--- .../view/errors/missing_behavior_class.ctp | 6 ++-- .../view/errors/missing_behavior_file.ctp | 6 ++-- .../view/errors/missing_component_class.ctp | 6 ++-- .../view/errors/missing_component_file.ctp | 4 +-- cake/libs/view/errors/missing_connection.ctp | 6 ++-- cake/libs/view/errors/missing_controller.ctp | 6 ++-- cake/libs/view/errors/missing_database.ctp | 4 +-- .../libs/view/errors/missing_helper_class.ctp | 6 ++-- cake/libs/view/errors/missing_helper_file.ctp | 6 ++-- cake/libs/view/errors/missing_layout.ctp | 6 ++-- cake/libs/view/errors/missing_table.ctp | 4 +-- cake/libs/view/errors/missing_view.ctp | 6 ++-- cake/libs/view/errors/private_action.ctp | 6 ++-- cake/libs/view/errors/scaffold_error.ctp | 2 +- cake/libs/view/helper.php | 2 +- cake/libs/view/helpers/form.php | 4 +-- cake/libs/view/helpers/js.php | 2 +- cake/libs/view/helpers/number.php | 10 +++--- cake/libs/view/helpers/time.php | 8 ++--- cake/libs/view/pages/home.ctp | 4 +-- cake/libs/view/scaffolds/edit.ctp | 4 +-- cake/libs/view/scaffolds/index.ctp | 6 ++-- cake/libs/view/scaffolds/view.ctp | 22 ++++++------ cake/libs/view/view.php | 4 +-- cake/tests/cases/libs/file.test.php | 3 +- cake/tests/lib/cake_fixture_manager.php | 2 +- .../tests/lib/reporter/cake_base_reporter.php | 2 +- .../tests/lib/reporter/cake_html_reporter.php | 6 ++-- cake/tests/lib/test_manager.php | 4 +-- cake/tests/test_app/views/pages/home.ctp | 6 ++-- .../views/posts/test_nocache_tags.ctp | 2 +- 78 files changed, 239 insertions(+), 240 deletions(-) diff --git a/cake/console/libs/console_error_handler.php b/cake/console/libs/console_error_handler.php index 4a7b6ceed..0e7c28af1 100644 --- a/cake/console/libs/console_error_handler.php +++ b/cake/console/libs/console_error_handler.php @@ -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(__("%s Error: %s\n"), $name, $message)); + $message = __('%s in [%s, line %s]', $description, $file, $line); + $stderr->write(__("%s Error: %s\n", $name, $message)); if (Configure::read('debug') == 0) { App::import('Core', 'CakeLog'); diff --git a/cake/console/libs/console_input_argument.php b/cake/console/libs/console_input_argument.php index 0a82bc425..c0ed84fc0 100644 --- a/cake/console/libs/console_input_argument.php +++ b/cake/console/libs/console_input_argument.php @@ -75,7 +75,7 @@ class ConsoleInputArgument { $optional = __(' (optional)'); } if (!empty($this->_choices)) { - $optional .= sprintf(__(' (choices: %s)'), implode('|', $this->_choices)); + $optional .= __(' (choices: %s)', implode('|', $this->_choices)); } return sprintf('%s%s%s', $name, $this->_help, $optional); } diff --git a/cake/console/libs/console_input_option.php b/cake/console/libs/console_input_option.php index 3d8267277..d4d831aa1 100644 --- a/cake/console/libs/console_input_option.php +++ b/cake/console/libs/console_input_option.php @@ -82,10 +82,10 @@ class ConsoleInputOption { public function help($width = 0) { $default = $short = ''; if (!empty($this->_default) && $this->_default !== true) { - $default = sprintf(__(' (default: %s)'), $this->_default); + $default = __(' (default: %s)', $this->_default); } if (!empty($this->_choices)) { - $default .= sprintf(__(' (choices: %s)'), implode('|', $this->_choices)); + $default .= __(' (choices: %s)', implode('|', $this->_choices)); } if (!empty($this->_short)) { $short = ', -' . $this->_short; diff --git a/cake/console/libs/console_option_parser.php b/cake/console/libs/console_option_parser.php index d6cccba1e..8a9f8af65 100644 --- a/cake/console/libs/console_option_parser.php +++ b/cake/console/libs/console_option_parser.php @@ -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(); diff --git a/cake/console/shells/acl.php b/cake/console/shells/acl.php index 2ffaa4609..e29e4f4ef 100644 --- a/cake/console/shells/acl.php +++ b/cake/console/shells/acl.php @@ -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(__("New %s '%s' created."), $class, $this->args[2]), 2); + $this->out(__("New %s '%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(__('%s deleted.'), $class), 2); + $this->out(__('%s deleted.', $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 allowed.'), $aroName), true); + $this->out(__('%s is allowed.', $aroName), true); } else { - $this->out(sprintf(__('%s is not allowed.'), $aroName), true); + $this->out(__('%s is not allowed.', $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"); } diff --git a/cake/console/shells/api.php b/cake/console/shells/api.php index d0c19da7e..0c036d09d 100644 --- a/cake/console/shells/api.php +++ b/cake/console/shells/api.php @@ -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); diff --git a/cake/console/shells/schema.php b/cake/console/shells/schema.php index dc863f6e5..b09b4c74d 100644 --- a/cake/console/shells/schema.php +++ b/cake/console/shells/schema.php @@ -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)); } } } diff --git a/cake/console/shells/shell.php b/cake/console/shells/shell.php index 11cb62d11..55c81f94d 100644 --- a/cake/console/shells/shell.php +++ b/cake/console/shells/shell.php @@ -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: %s'), $title)); + $this->err(__('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(__('File `%s` exists'), $path)); + $this->out(__('File `%s` exists', $path)); $key = $this->in(__('Do you want to overwrite?'), array('y', 'n', 'q'), 'n'); if (strtolower($key) == 'q') { $this->out(__('Quitting.'), 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(__('Wrote `%s`'), $path)); + $this->out(__('Wrote `%s`', $path)); return true; } else { - $this->err(sprintf(__('Could not write to `%s`.'), $path), 2); + $this->err(__('Could not write to `%s`.', $path), 2); return false; } } diff --git a/cake/console/shells/tasks/controller.php b/cake/console/shells/tasks/controller.php index f56f55d3b..6ec3c4371 100644 --- a/cake/console/shells/tasks/controller.php +++ b/cake/console/shells/tasks/controller.php @@ -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;"); diff --git a/cake/console/shells/tasks/extract.php b/cake/console/shells/tasks/extract.php index 78a95fb3d..34c24314e 100644 --- a/cake/console/shells/tasks/extract.php +++ b/cake/console/shells/tasks/extract.php @@ -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; diff --git a/cake/console/shells/tasks/fixture.php b/cake/console/shells/tasks/fixture.php index 333359121..88eb5241a 100644 --- a/cake/console/shells/tasks/fixture.php +++ b/cake/console/shells/tasks/fixture.php @@ -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; diff --git a/cake/console/shells/tasks/model.php b/cake/console/shells/tasks/model.php index 6abd25344..7616ef14c 100644 --- a/cake/console/shells/tasks/model.php +++ b/cake/console/shells/tasks/model.php @@ -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') { diff --git a/cake/console/shells/tasks/plugin.php b/cake/console/shells/tasks/plugin.php index de0d4713a..6ae7bd5cb 100644 --- a/cake/console/shells/tasks/plugin.php +++ b/cake/console/shells/tasks/plugin.php @@ -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(__("Plugin Name: %s"), $plugin)); - $this->out(sprintf(__("Plugin Directory: %s"), $this->path . $pluginPath)); + $this->out(__("Plugin Name: %s", $plugin)); + $this->out(__("Plugin Directory: %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(__('Created: %s in %s'), $plugin, $this->path . $pluginPath), 2); + $this->out(__('Created: %s in %s', $plugin, $this->path . $pluginPath), 2); } return true; diff --git a/cake/console/shells/tasks/project.php b/cake/console/shells/tasks/project.php index 3710a9906..bb2a8f34b 100644 --- a/cake/console/shells/tasks/project.php +++ b/cake/console/shells/tasks/project.php @@ -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(__('A project already exists in this location: %s Overwrite?'), $project); + $prompt = __('A project already exists in this location: %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(__(' * Remember to check these value after moving to production server')); } 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(__('Created: %s in %s'), $app, $path)); + $this->out(__('Created: %s in %s', $app, $path)); $this->hr(); } else { - $this->err(sprintf(__("Could not create '%s' properly."), $app)); + $this->err(__("Could not create '%s' properly.", $app)); return false; } diff --git a/cake/console/shells/tasks/template.php b/cake/console/shells/tasks/template.php index be892c87c..85eed96c6 100644 --- a/cake/console/shells/tasks/template.php +++ b/cake/console/shells/tasks/template.php @@ -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; } } diff --git a/cake/console/shells/tasks/test.php b/cake/console/shells/tasks/test.php index 173a65079..093457421 100644 --- a/cake/console/shells/tasks/test.php +++ b/cake/console/shells/tasks/test.php @@ -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); diff --git a/cake/console/shells/tasks/view.php b/cake/console/shells/tasks/view.php index 14d67b7fe..bf8777238 100644 --- a/cake/console/shells/tasks/view.php +++ b/cake/console/shells/tasks/view.php @@ -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') { diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/cake/console/templates/default/actions/controller_actions.ctp index 1b635e0ce..370879e66 100644 --- a/cake/console/templates/default/actions/controller_actions.ctp +++ b/cake/console/templates/default/actions/controller_actions.ctp @@ -77,7 +77,7 @@ $this->Session->setFlash(__('Invalid ')); $this->redirect(array('action' => 'index')); - $this->flash(sprintf(__('Invalid ')), array('action' => 'index')); + $this->flash(__('Invalid '), array('action' => 'index')); } if ($this->request->is('post')) { @@ -123,7 +123,7 @@ $this->Session->setFlash(__('Invalid id for ')); $this->redirect(array('action'=>'index')); - $this->flash(sprintf(__('Invalid ')), array('action' => 'index')); + $this->flash(__('Invalid '), array('action' => 'index')); } if ($this->->delete($id)) { diff --git a/cake/console/templates/default/views/form.ctp b/cake/console/templates/default/views/form.ctp index 7842e14c0..455648ed7 100644 --- a/cake/console/templates/default/views/form.ctp +++ b/cake/console/templates/default/views/form.ctp @@ -47,7 +47,7 @@
    -
  • 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}'))); ?>";?>
  • +
  • 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}'))); ?>";?>
  • Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index'));?>";?>
  • '; - printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), ''. \$settings['engine'] . 'Engine'); + echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', ''. \$settings['engine'] . 'Engine'); echo ''; else: echo ''; @@ -75,9 +75,9 @@ $output .= "\n"; $output .= "

    \n"; $output .= "

    \n"; $output .= "', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.
    ', APP . 'webroot' . DS . 'css');\n"; $output .= "?>\n"; $output .= "

    \n"; diff --git a/cake/console/templates/default/views/index.ctp b/cake/console/templates/default/views/index.ctp index f59dadaaa..0732fe058 100644 --- a/cake/console/templates/default/views/index.ctp +++ b/cake/console/templates/default/views/index.ctp @@ -55,7 +55,7 @@ echo "\t\t\n"; echo "\t\t\tHtml->link(__('View'), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; echo "\t\t\tHtml->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; - echo "\t\t\tForm->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\tForm->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; echo "\t\t\n"; echo "\t\n"; diff --git a/cake/console/templates/default/views/view.ctp b/cake/console/templates/default/views/view.ctp index 834672068..9e791196f 100644 --- a/cake/console/templates/default/views/view.ctp +++ b/cake/console/templates/default/views/view.ctp @@ -46,7 +46,7 @@ foreach ($fields as $field) {
      Html->link(__('Edit " . $singularHumanName ."'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> \n"; - echo "\t\t
    • Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?'), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>
    • \n"; + echo "\t\t
    • Form->postLink(__('Delete " . $singularHumanName . "'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>
    • \n"; echo "\t\t
    • Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?>
    • \n"; echo "\t\t
    • Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>
    • \n"; @@ -129,7 +129,7 @@ echo "\t\n"; echo "\t\t\t\tHtml->link(__('View'), array('controller' => '{$details['controller']}', 'action' => 'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; echo "\t\t\t\tHtml->link(__('Edit'), array('controller' => '{$details['controller']}', 'action' => 'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; - echo "\t\t\t\tForm->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\tForm->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\n"; echo "\t\t\n"; diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 259bdc490..e211d20f9 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -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 ); } diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index ced48589b..687a74f72 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -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; diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index b478a75d0..9b121e89f 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -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); diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index f1c5b32cf..5e8887c65 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -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; } diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index aa4b0a95c..dcc662144 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -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) { diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index cc2ebeb3b..4e7b22c38 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -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; } diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 34b6bbc52..76cffb12d 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -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); diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 77f2cccc2..a8d811d3d 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -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; } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index a41d88e54..a075f4fcf 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -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: diff --git a/cake/libs/error/exceptions.php b/cake/libs/error/exceptions.php index 99cc3a946..7c1ff2a01 100644 --- a/cake/libs/error/exceptions.php +++ b/cake/libs/error/exceptions.php @@ -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); } diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 36cba374b..551e05876 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -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); } } } diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index aaf3b504c..7433b2bf8 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -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; diff --git a/cake/libs/model/behavior_collection.php b/cake/libs/model/behavior_collection.php index 3ce783c76..b5fbfe0f0 100644 --- a/cake/libs/model/behavior_collection.php +++ b/cake/libs/model/behavior_collection.php @@ -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)); diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 842fd26f6..dd8647557 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -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); } } diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 8e4f87ab2..624c467f0 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -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; } diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 9e5a3c799..7397767d0 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -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; diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index dbf5d3c3f..c3dfbf17d 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -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']]; diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 40dc1e2bf..42b2c5003 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -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; diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index c559a28a4..6ade6a59f 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -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 '
      ' . sprintf(__('SQL Error in model %s:'), $model->alias) . ' '; + echo '
      ' . __('SQL Error in model %s:', $model->alias) . ' '; if (isset($this->error) && $this->error != null) { echo $this->error; } diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 819f3f02c..67ca2111e 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -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; } diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 2e4387852..566463610 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -662,7 +662,7 @@ class DboSource extends DataSource { if ($error) { trigger_error('' . __('SQL Error:') . " {$this->error}", E_USER_WARNING); } else { - $out = ('[' . sprintf(__('Aff:%s Num:%s Took:%sms'), $this->affected, $this->numRows, $this->took) . ']'); + $out = ('[' . __('Aff:%s Num:%s Took:%sms', $this->affected, $this->numRows, $this->took) . ']'); } pr(sprintf('

      ' . __('Query:') . ' %s %s

      ', $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 '
      ' . sprintf(__('SQL Error in model %s:'), $model->alias) . ' '; + echo '
      ' . __('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; } diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index b9bd815b0..70826bdb7 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -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; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index b34d175e0..085e1af94 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -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 ); } diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 7297491bd..5a65ae2d6 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -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; diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 53f5cce0e..19cfe6222 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -17,14 +17,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -

      +

      : - ' . $action . '', '' . $controller . ''); ?> + ' . $action . '', '' . $controller . ''); ?>

      : - ' . $controller . '::', '' . $action . '()', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> + ' . $controller . '::', '' . $action . '()', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>

       <?php
      @@ -40,6 +40,6 @@ class  extends AppController {
       

      : - +

      element('exception_stack_trace'); ?> diff --git a/cake/libs/view/errors/missing_behavior_class.ctp b/cake/libs/view/errors/missing_behavior_class.ctp index 4ac4266e8..eb19034b8 100644 --- a/cake/libs/view/errors/missing_behavior_class.ctp +++ b/cake/libs/view/errors/missing_behavior_class.ctp @@ -20,11 +20,11 @@

      : - %s can not be found or does not exist.'), $class); ?> + %s can not be found or does not exist.', $class); ?>

      : - +

       <?php
      @@ -35,7 +35,7 @@ class  extends ModelBehavior {
       

      : - +

      element('exception_stack_trace'); ?> diff --git a/cake/libs/view/errors/missing_behavior_file.ctp b/cake/libs/view/errors/missing_behavior_file.ctp index 88dbd9e6e..6f90206c1 100644 --- a/cake/libs/view/errors/missing_behavior_file.ctp +++ b/cake/libs/view/errors/missing_behavior_file.ctp @@ -20,11 +20,11 @@

      : - +

      : - +

       <?php
      @@ -35,7 +35,7 @@ class  extends ModelBehavior {
       

      : - +

      element('exception_stack_trace'); ?> diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index 0a597a9bd..ccb0497ef 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -20,11 +20,11 @@

      : - ' . $class . ''); ?> + ' . $class . ''); ?>

      : - ' . $class . '', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> + ' . $class . '', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>

       <?php
      @@ -35,7 +35,7 @@ class  extends Component {

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index 9338c1e24..592238fb4 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -24,7 +24,7 @@

      : - ' . $class . '', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> + ' . $class . '', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>

       <?php
      @@ -35,7 +35,7 @@ class  extends Component {

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_connection.ctp b/cake/libs/view/errors/missing_connection.ctp index cda9afeb9..2f11f4f5f 100644 --- a/cake/libs/view/errors/missing_connection.ctp +++ b/cake/libs/view/errors/missing_connection.ctp @@ -20,15 +20,15 @@

      : - +

      : - +

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index d7aecbc9a..d45d8d31c 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -20,11 +20,11 @@

      : - ' . $controller . ''); ?> + ' . $controller . ''); ?>

      : - ' . $controller . '', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> + ' . $controller . '', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>

       <?php
      @@ -35,7 +35,7 @@ class  extends AppController {
       

      : - +

      element('exception_stack_trace'); ?> diff --git a/cake/libs/view/errors/missing_database.ctp b/cake/libs/view/errors/missing_database.ctp index b9e90cc4e..d3e4944f6 100644 --- a/cake/libs/view/errors/missing_database.ctp +++ b/cake/libs/view/errors/missing_database.ctp @@ -24,11 +24,11 @@

      : - +

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index 58dd7a56e..9742a1563 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -20,11 +20,11 @@

      : - %s can not be found or does not exist.'), $class); ?> + %s can not be found or does not exist.', $class); ?>

      : - +

       <?php
      @@ -35,7 +35,7 @@ class  extends AppHelper {
       

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index 9ee18817b..69bf38e30 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -20,11 +20,11 @@

      : - +

      : - +

       <?php
      @@ -35,7 +35,7 @@ class  extends AppHelper {
       

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index 043be5bed..28445cc77 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -20,15 +20,15 @@

      : - ' . $file . ''); ?> + ' . $file . ''); ?>

      : - ' . $file . ''); ?> + ' . $file . ''); ?>

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index d849b6308..b639856fe 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -20,11 +20,11 @@

      : - ' . $table . '', '' . $class . ''); ?> + ' . $table . '', '' . $class . ''); ?>

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index d175b34af..658f4d1ce 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -20,15 +20,15 @@

      : - ' . Inflector::camelize($this->request->controller) . 'Controller::', '' . $this->request->action . '()'); ?> + ' . Inflector::camelize($this->request->controller) . 'Controller::', '' . $this->request->action . '()'); ?>

      : - +

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index 559086165..c91062ba2 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -17,14 +17,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -

      +

      : - ' . $controller . '::', '' . $action . '()'); ?> + ' . $controller . '::', '' . $action . '()'); ?>

      : - +

      element('exception_stack_trace'); ?> \ No newline at end of file diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index f927006d7..931cbdca5 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -24,7 +24,7 @@

      : - +

       <?php
      diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php
      index 20e41953c..59470ea9f 100644
      --- a/cake/libs/view/helper.php
      +++ b/cake/libs/view/helper.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);
       	}
       
       /**
      diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php
      index 0fe0e0ad2..9445d9695 100644
      --- a/cake/libs/view/helpers/form.php
      +++ b/cake/libs/view/helpers/form.php
      @@ -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];
      diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php
      index c4809c30c..9fcecaab9 100644
      --- a/cake/libs/view/helpers/js.php
      +++ b/cake/libs/view/helpers/js.php
      @@ -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);
       	}
       
       /**
      diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php
      index b7d612471..03e01eea2 100644
      --- a/cake/libs/view/helpers/number.php
      +++ b/cake/libs/view/helpers/number.php
      @@ -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));
       		}
       	}
       
      diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php
      index df1a34051..31093a556 100644
      --- a/cake/libs/view/helpers/time.php
      +++ b/cake/libs/view/helpers/time.php
      @@ -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;
      diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp
      index c8939c85e..67b121a93 100644
      --- a/cake/libs/view/pages/home.ctp
      +++ b/cake/libs/view/pages/home.ctp
      @@ -20,7 +20,7 @@ if (Configure::read() == 0):
       	$this->cakeError('error404');
       endif;
       ?>
      -

      +

      0): @@ -45,7 +45,7 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo ''; - printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), ''. $settings['engine'] . 'Engine'); + echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', ''. $settings['engine'] . 'Engine'); echo ''; else: echo ''; diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 613c6a90e..3e59682b5 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -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
    • " . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "
    • \n"; - echo "\t\t
    • " . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "
    • \n"; + echo "\t\t
    • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "
    • \n"; + echo "\t\t
    • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "
    • \n"; $done[] = $_details['controller']; } } diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index 094a32e09..7a4f49aef 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -76,14 +76,14 @@ echo "\n";

        -
      • Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')); ?>
      • +
      • Html->link(__('New %s', $singularHumanName), array('action' => 'add')); ?>
      • $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
      • " . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
      • \n"; - echo "\t\t
      • " . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
      • \n"; + echo "\t\t
      • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
      • \n"; + echo "\t\t
      • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
      • \n"; $done[] = $_details['controller']; } } diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index d1f9963dc..963c59acc 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -18,7 +18,7 @@ */ ?>
        -

        +

          " .$this->Html->link(sprintf(__('Edit %s'), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " \n"; - echo "\t\t
        • " .$this->Html->link(sprintf(__('Delete %s'), $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). "
        • \n"; - echo "\t\t
        • " .$this->Html->link(sprintf(__('List %s'), $pluralHumanName), array('action' => 'index')). "
        • \n"; - echo "\t\t
        • " .$this->Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')). "
        • \n"; + echo "\t\t
        • " .$this->Html->link(__('Edit %s', $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). "
        • \n"; + echo "\t\t
        • " .$this->Html->link(__('Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). "
        • \n"; + echo "\t\t
        • " .$this->Html->link(__('List %s', $pluralHumanName), array('action' => 'index')). "
        • \n"; + echo "\t\t
        • " .$this->Html->link(__('New %s', $singularHumanName), array('action' => 'add')). "
        • \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
        • " . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
        • \n"; - echo "\t\t
        • " . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
        • \n"; + echo "\t\t
        • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
        • \n"; + echo "\t\t
        • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
        • \n"; $done[] = $_details['controller']; } } @@ -72,7 +72,7 @@ foreach ($scaffoldFields as $_field) { if (!empty($associations['hasOne'])) : foreach ($associations['hasOne'] as $_alias => $_details): ?> @@ -111,7 +111,7 @@ foreach ($relations as $_alias => $_details): $otherSingularVar = Inflector::variable($_alias); ?>