diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index b3442998d..7780749da 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -245,7 +245,7 @@ class CakeSession extends Object { * @deprecated Use CakeSession::delete instead */ function del($name) { - trigger_error('CakeSession::del() is deprecated, use CakeSession::delete() instead.', E_USER_WARNING); + trigger_error(__('CakeSession::del() is deprecated, use CakeSession::delete() instead.', true), E_USER_WARNING); return $this->delete($name); } @@ -259,12 +259,12 @@ class CakeSession extends Object { function delete($name) { if ($this->check($name)) { if (in_array($name, $this->watchKeys)) { - trigger_error('Deleting session key {' . $name . '}', E_USER_NOTICE); + trigger_error(sprintf(__('Deleting session key {%s}', true), $name), E_USER_NOTICE); } $this->__overwrite($_SESSION, Set::remove($_SESSION, $name)); return ($this->check($name) == false); } - $this->__setError(2, "$name doesn't exist"); + $this->__setError(2, sprintf(__("%s doesn't exist", true), $name)); return false; } @@ -423,7 +423,7 @@ class CakeSession extends Object { return false; } if (in_array($name, $this->watchKeys)) { - trigger_error('Writing session key {' . $name . '}: ' . Debugger::exportVar($value), E_USER_NOTICE); + trigger_error(sprintf(__('Writing session key {%s}: %s', true), $name, Debugger::exportVar($value)), E_USER_NOTICE); } $this->__overwrite($_SESSION, Set::insert($_SESSION, $name, $value)); return (Set::classicExtract($_SESSION, $name) === $value); diff --git a/cake/libs/configure.php b/cake/libs/configure.php index fb463fa6a..a810b99ad 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -261,8 +261,7 @@ class Configure extends Object { } if (!isset($config)) { - $error = __("Configure::load() - no variable \$config found in %s.php", true); - trigger_error(sprintf($error, $fileName), E_USER_WARNING); + trigger_error(sprintf(__('Configure::load() - no variable $config found in %s.php', true), $fileName), E_USER_WARNING); return false; } return Configure::write($config); @@ -398,7 +397,7 @@ class Configure extends Object { $cache = Cache::config('default'); if (empty($cache['settings'])) { - trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING); + trigger_error(__('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', true), E_USER_WARNING); $cache = Cache::config('default', array('engine' => 'File')); } $path = $prefix = $duration = null; diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 1e15fcb78..1a6a049d9 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -248,12 +248,12 @@ class DbAcl extends AclBase { $acoPath = $this->Aco->node($aco); if (empty($aroPath) || empty($acoPath)) { - trigger_error("DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: " . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); + trigger_error(__("DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ", true) . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); return false; } if ($acoPath == null || $acoPath == array()) { - trigger_error("DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: " . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); + trigger_error(__("DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ", true) . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); return false; } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index bdbeb7146..258c7bb82 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -403,9 +403,7 @@ class AuthComponent extends Object { if (isset($controller->Acl)) { $this->Acl =& $controller->Acl; } else { - $err = 'Could not find AclComponent. Please include Acl in '; - $err .= 'Controller::$components.'; - trigger_error(__($err, true), E_USER_WARNING); + trigger_error(__('Could not find AclComponent. Please include Acl in Controller::$components.', true), E_USER_WARNING); } break; case 'model': @@ -514,10 +512,8 @@ class AuthComponent extends Object { case 'crud': $this->mapActions(); if (!isset($this->actionMap[$this->params['action']])) { - $err = 'Auth::startup() - Attempted access of un-mapped action "%1$s" in'; - $err .= ' controller "%2$s"'; trigger_error( - sprintf(__($err, true), $this->params['action'], $this->params['controller']), + sprintf(__('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', true), $this->params['action'], $this->params['controller']), E_USER_WARNING ); } else { diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index d6783c3bd..a7403b2c6 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -263,7 +263,7 @@ class CookieComponent extends Object { * @deprecated use delete() */ function del($key) { - trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use CookieComponent::delete instead', true), E_USER_WARNING); return $this->delete($key); } diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 8eb16fec4..f29f92c51 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -611,7 +611,7 @@ class EmailComponent extends Object{ $formatted = array(); if ($this->_lineLength !== null) { - trigger_error('_lineLength cannot be accessed please use lineLength', E_USER_WARNING); + trigger_error(__('_lineLength cannot be accessed please use lineLength', true), E_USER_WARNING); $this->lineLength = $this->_lineLength; } diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index fbbf01afa..8cefb3917 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -425,7 +425,7 @@ class RequestHandlerComponent extends Object { * @deprecated use getReferer() */ function getReferrer() { - trigger_error('Deprecated method, use RequestHandlerComponent::getReferer instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use RequestHandlerComponent::getReferer instead', true), E_USER_WARNING); return $this->getReferer(); } diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index cc4820c4b..11e735859 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -141,7 +141,7 @@ class SessionComponent extends CakeSession { * @deprecated use delete */ function del($name) { - trigger_error('Deprecated method, use SessionComponent::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use SessionComponent::delete instead', true), E_USER_WARNING); if ($this->__active === true) { $this->__start(); return parent::del($name); diff --git a/cake/libs/folder.php b/cake/libs/folder.php index cb5f4f9e0..6e4c23d3a 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -723,7 +723,7 @@ class Folder extends Object { * @access public */ function ls($sort = true, $exceptions = false) { - trigger_error('Deprecated method, use Folder::read instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::read instead', true), E_USER_WARNING); return $this->read($sort, $exceptions); } @@ -735,7 +735,7 @@ class Folder extends Object { * @access public */ function mkdir($pathname, $mode = 0755) { - trigger_error('Deprecated method, use Folder::create instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::create instead', true), E_USER_WARNING); return $this->create($pathname, $mode); } @@ -747,7 +747,7 @@ class Folder extends Object { * @access public */ function cp($options) { - trigger_error('Deprecated method, use Folder::copy instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::copy instead', true), E_USER_WARNING); return $this->copy($options); } @@ -759,7 +759,7 @@ class Folder extends Object { * @access public */ function mv($options) { - trigger_error('Deprecated method, use Folder::move instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::move instead', true), E_USER_WARNING); return $this->move($options); } @@ -771,7 +771,7 @@ class Folder extends Object { * @access public */ function rm($path) { - trigger_error('Deprecated method, use Folder::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::delete instead', true), E_USER_WARNING); return $this->delete($path); } diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index a103c5008..947f3b3e0 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -59,7 +59,7 @@ class AclBehavior extends ModelBehavior { $model->{$type} =& ClassRegistry::init($type); } if (!method_exists($model, 'parentNode')) { - trigger_error("Callback parentNode() not defined in {$model->alias}", E_USER_WARNING); + trigger_error(sprintf(__('Callback parentNode() not defined in %s', true), $model->alias), E_USER_WARNING); } } diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 82b2e8913..7ae1ae7c3 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -545,7 +545,7 @@ class CakeSchema extends Object { $value['key'] = 'primary'; } if (!isset($db->columns[$value['type']])) { - trigger_error('Schema generation error: invalid column type ' . $value['type'] . ' does not exist in DBO', E_USER_NOTICE); + trigger_error(sprintf(__('Schema generation error: invalid column type %s does not exist in DBO', true), $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 0adf16b64..b09eda5c4 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -181,8 +181,7 @@ class ConnectionManager extends Object { $class = "{$conn['plugin']}.{$conn['classname']}"; if (!App::import('Datasource', $class, false)) { - $error = __('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true); - trigger_error(sprintf($error, $class), E_USER_ERROR); + trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR); return null; } return true; diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 2e26fdb92..86e78fc31 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -111,7 +111,7 @@ class DboMssql extends DboSource { function __construct($config, $autoConnect = true) { if ($autoConnect) { if (!function_exists('mssql_min_message_severity')) { - trigger_error("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/", E_USER_WARNING); + trigger_error(__("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/", true), E_USER_WARNING); } mssql_min_message_severity(15); mssql_min_error_severity(2); diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 04d322a43..5c991b026 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -583,7 +583,7 @@ class DboOracle extends DboSource { */ function constraint($action, $table) { if (empty($table)) { - trigger_error(__('Must specify table to operate on constraints')); + trigger_error(__('Must specify table to operate on constraints', true)); } $table = strtoupper($table); @@ -641,7 +641,7 @@ class DboOracle extends DboSource { return $constraints; break; default: - trigger_error(__('DboOracle::constraint() accepts only enable, disable, or list')); + trigger_error(__('DboOracle::constraint() accepts only enable, disable, or list', true)); } } return true; diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 3bfa760b8..6a79bf1be 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -490,12 +490,12 @@ class DboSqlite extends DboSource { extract($column); if (empty($name) || empty($type)) { - trigger_error('Column name or type not defined in schema', E_USER_WARNING); + trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING); return null; } if (!isset($this->columns[$type])) { - trigger_error("Column type {$type} does not exist", E_USER_WARNING); + trigger_error(sprintf(__('Column type %s does not exist', true), $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 88b673dfe..047ac879b 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -632,11 +632,11 @@ class DboSource extends DataSource { if (Configure::read() > 0) { $out = null; if ($error) { - trigger_error("SQL Error: {$this->error}", E_USER_WARNING); + trigger_error('' . __('SQL Error:', true) . " {$this->error}", E_USER_WARNING); } else { - $out = ("[Aff:{$this->affected} Num:{$this->numRows} Took:{$this->took}ms]"); + $out = ('[' . sprintf(__('Aff:%s Num:%s Took:%sms', true), $this->affected, $this->numRows, $this->took) . ']'); } - pr(sprintf("

Query: %s %s

", $sql, $out)); + pr(sprintf('

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

', $sql, $out)); } } @@ -2386,7 +2386,7 @@ class DboSource extends DataSource { */ function length($real) { if (!preg_match_all('/([\w\s]+)(?:\((\d+)(?:,(\d+))?\))?(\sunsigned)?(\szerofill)?/', $real, $result)) { - trigger_error(__('FIXME: Can\'t parse field: ' . $real, true), E_USER_WARNING); + trigger_error(__("FIXME: Can't parse field: " . $real, true), E_USER_WARNING); $col = str_replace(array(')', 'unsigned'), '', $real); $limit = null; @@ -2585,12 +2585,12 @@ class DboSource extends DataSource { extract(array_merge(array('null' => true), $column)); if (empty($name) || empty($type)) { - trigger_error('Column name or type not defined in schema', E_USER_WARNING); + trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING); return null; } if (!isset($this->columns[$type])) { - trigger_error("Column type {$type} does not exist", E_USER_WARNING); + trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING); return null; } diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index 6599f2ac9..af65e8e92 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -142,7 +142,7 @@ class AclNode extends AppModel { } if (empty($model)) { - trigger_error("Model class '$name' not found in AclNode::node() when trying to bind {$this->alias} object", E_USER_WARNING); + trigger_error(sprintf(__("Model class '%s' not found in AclNode::node() when trying to bind %s object", true), $type, $this->alias), E_USER_WARNING); return null; } @@ -187,7 +187,7 @@ class AclNode extends AppModel { $result = $db->read($this, $queryData, -1); if (!$result) { - trigger_error("AclNode::node() - Couldn't find {$type} node identified by \"" . print_r($ref, true) . "\"", E_USER_WARNING); + trigger_error(sprintf(__("AclNode::node() - Couldn't find %s node identified by \"%s\"", true), $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 b936fc7d7..32b3d5003 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -530,7 +530,7 @@ class Model extends Overloadable { * @deprecated Use Model::bindModel() instead. */ function bind($model, $options = array(), $permanent = true) { - trigger_error('Deprecated method, use Model::bindModel instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::bindModel instead', true), E_USER_WARNING); if (!is_array($model)) { $model = array($model => $options); } @@ -1809,7 +1809,7 @@ class Model extends Overloadable { * @link http://book.cakephp.org/view/691/remove */ function remove($id = null, $cascade = true) { - trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); return $this->delete($id, $cascade); } @@ -1862,7 +1862,7 @@ class Model extends Overloadable { * @deprecated */ function del($id = null, $cascade = true) { - trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); return $this->delete($id, $cascade); } @@ -2615,12 +2615,7 @@ class Model extends Overloadable { } elseif (!is_array($validator['rule'])) { $valid = preg_match($rule, $data[$fieldName]); } elseif (Configure::read('debug') > 0) { - $error = sprintf( - __('Could not find validation handler %s for %s', true), - $rule, - $fieldName - ); - trigger_error($error, E_USER_WARNING); + trigger_error(sprintf(__('Could not find validation handler %s for %s', true), $rule, $fieldName), E_USER_WARNING); } if (!$valid || (is_string($valid) && strlen($valid) > 0)) { @@ -2727,7 +2722,7 @@ class Model extends Overloadable { * @deprecated */ function getDisplayField() { - trigger_error('Deprecated method, use Model::$displayField instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::$displayField instead', true), E_USER_WARNING); return $this->displayField; } diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index e5fd759de..4e5eeeea3 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -441,7 +441,7 @@ class BehaviorCollection extends Object { $call = null; if ($strict && !$found) { - trigger_error("BehaviorCollection::dispatchMethod() - Method {$method} not found in any attached behavior", E_USER_WARNING); + trigger_error(sprintf(__("BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", true), $method), E_USER_WARNING); return null; } elseif ($found) { $methods = array_combine($methods, array_values($this->__methods)); diff --git a/cake/libs/set.php b/cake/libs/set.php index 40929479a..2f9551a99 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -828,7 +828,7 @@ class Set { * @deprecated */ function isEqual($val1, $val2 = null) { - trigger_error('Set::isEqual() is deprecated. Please use standard comparison operators instead.', E_USER_WARNING); + trigger_error(__('Set::isEqual() is deprecated. Please use standard comparison operators instead.', true), E_USER_WARNING); return ($val1 == $val2); } diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 8b326efc5..8a29da535 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -92,11 +92,7 @@ class PaginatorHelper extends AppHelper { App::import('Helper', $ajaxProvider); $classname = $ajaxProvider . 'Helper'; if (!is_callable(array($classname, 'link'))) { - $message = sprintf( - __('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), - $classname - ); - trigger_error($message, E_USER_WARNING); + trigger_error(sprintf(__('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), $classname), E_USER_WARNING); } } diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 63b02925e..21883781c 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -273,7 +273,7 @@ class TextHelper extends AppHelper { * @access public */ function trim() { - trigger_error('TextHelper::trim() is deprecated. Use TextHelper::truncate() instead', E_USER_WARNING); + trigger_error(__('TextHelper::trim() is deprecated. Use TextHelper::truncate() instead', true), E_USER_WARNING); $args = func_get_args(); return call_user_func_array(array(&$this, 'truncate'), $args); } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 05917c107..fd7db3654 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -420,8 +420,7 @@ class View extends Object { $this->hasRendered = true; } else { $out = $this->_render($viewFileName, $this->viewVars); - $msg = __("Error in view %s, got:
%s
", true); - trigger_error(sprintf($msg, $viewFileName, $out), E_USER_ERROR); + trigger_error(sprintf(__("Error in view %s, got:
%s
", true), $viewFileName, $out), E_USER_ERROR); } return $out; } @@ -464,8 +463,7 @@ class View extends Object { if ($this->output === false) { $this->output = $this->_render($layoutFileName, $data_for_layout); - $msg = __("Error in layout %s, got:
%s
", true); - trigger_error(sprintf($msg, $layoutFileName, $this->output), E_USER_ERROR); + trigger_error(sprintf(__("Error in layout %s, got:
%s
", true), $layoutFileName, $this->output), E_USER_ERROR); return false; } diff --git a/cake/libs/xml.php b/cake/libs/xml.php index a1fe11368..02b561b44 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -402,7 +402,7 @@ class XmlNode extends Object { if (is_object($child)) { if ($this->compare($child)) { - trigger_error('Cannot append a node to itself.'); + trigger_error(__('Cannot append a node to itself.', true)); $return = false; return $return; } @@ -909,7 +909,7 @@ class Xml extends XmlNode { } elseif (file_exists($input)) { $this->__rawData = file_get_contents($input); } else { - trigger_error('XML cannot be read'); + trigger_error(__('XML cannot be read', true)); return false; } return $this->parse(); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 9e4c6beed..7696e8a2d 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -533,7 +533,7 @@ class CakeTestCase extends UnitTestCase { $fixture->truncate($this->db); $fixture->insert($this->db); } else { - trigger_error("Referenced fixture class {$class} not found", E_USER_WARNING); + trigger_error(sprintf(__('Referenced fixture class %s not found', true), $class), E_USER_WARNING); } } } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 5ddeaab84..1e88c734c 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -101,7 +101,7 @@ class CodeCoverageManager { $thisFile = str_replace('.php', '.test.php', basename(__FILE__)); if (strpos($testCaseFile, $thisFile) !== false) { - trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR); + trigger_error(__('Xdebug supports no parallel coverage analysis - so this is not possible.', true), E_USER_ERROR); } $manager->setParams($reporter); $manager->testCaseFile = $testCaseFile; @@ -223,7 +223,7 @@ class CodeCoverageManager { $testObjectFile = $this->__testObjectFilesFromGroupFile($this->testCaseFile, $this->appTest); foreach ($testObjectFile as $file) { if (!file_exists($file)) { - trigger_error('This test object file is invalid: ' . $file); + trigger_error(sprintf(__('This test object file is invalid: %s', true), $file)); return ; } } @@ -236,7 +236,7 @@ class CodeCoverageManager { $testObjectFile = $this->__testObjectFileFromCaseFile($this->testCaseFile, $this->appTest); if (!file_exists($testObjectFile)) { - trigger_error('This test object file is invalid: ' . $testObjectFile); + trigger_error(sprintf(__('This test object file is invalid: %s', true), $testObjectFile)); return ; } @@ -551,7 +551,7 @@ class CodeCoverageManager { $path .= DS . $groupFile . $testManager->_groupExtension; if (!file_exists($path)) { - trigger_error('This group file does not exist!'); + trigger_error(__('This group file does not exist!', true)); return array(); } @@ -736,7 +736,7 @@ class CodeCoverageManager { */ function __calcCoverage($lineCount, $coveredCount) { if ($coveredCount > $lineCount) { - trigger_error('Sorry, you cannot have more covered lines than total lines!'); + trigger_error(__('Sorry, you cannot have more covered lines than total lines!', true)); } return ($lineCount != 0) ? round(100 * $coveredCount / $lineCount, 2) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 21ee551ca..a71665301 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -101,11 +101,11 @@ class TestManager { function runAllTests(&$reporter, $testing = false) { $testCases =& $this->_getTestFileList($this->_getTestsPath()); if ($this->appTest) { - $test =& new TestSuite('All App Tests'); + $test =& new TestSuite(__('All App Tests', true)); } else if ($this->pluginTest) { - $test =& new TestSuite('All ' . Inflector::humanize($this->pluginTest) . ' Plugin Tests'); + $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($manager->pluginTest))); } else { - $test =& new TestSuite('All Core Tests'); + $test =& new TestSuite(__('All Core Tests', true)); } if ($testing) { @@ -132,7 +132,7 @@ class TestManager { $testCaseFileWithPath = $this->_getTestsPath() . DS . $testCaseFile; if (!file_exists($testCaseFileWithPath)) { - trigger_error("Test case {$testCaseFile} cannot be found", E_USER_ERROR); + trigger_error(sprintf(__('Test case %s cannot be found', true), $testCaseFile), E_USER_ERROR); return false; } @@ -140,7 +140,7 @@ class TestManager { return true; } - $test =& new TestSuite("Individual test case: " . $testCaseFile); + $test =& new TestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile)); $test->addTestFile($testCaseFileWithPath); return $test->run($reporter); } @@ -157,11 +157,11 @@ class TestManager { $filePath = $this->_getTestsPath('groups') . DS . strtolower($groupTestName) . $this->_groupExtension; if (!file_exists($filePath)) { - trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR); + trigger_error(sprintf(__('Group test %s cannot be found at %s', true), $groupTestName, $filePath), E_USER_ERROR); } require_once $filePath; - $test =& new TestSuite($groupTestName . ' group test'); + $test =& new TestSuite(sprintf(__('%s group test', true), $groupTestName)); foreach ($this->_getGroupTestClassNames($filePath) as $groupTest) { $testCase = new $groupTest(); $test->addTestCase($testCase);