From 6bf6d799793ffe0dd0da8b6965dabd587d572d0f Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 14 Oct 2011 21:01:17 -0400 Subject: [PATCH] Removing 'cake' domain from core. This domain was supposed to be replaced by cake_dev. There are a number of translations that should be App land as well. Such as those in helpers. Fixes #2103 --- app/webroot/test.php | 2 +- .../Console/Templates/skel/webroot/test.php | 2 +- .../Controller/Component/AuthComponent.php | 2 +- lib/Cake/Controller/Scaffold.php | 20 ++++----- lib/Cake/Error/ExceptionRenderer.php | 4 +- lib/Cake/Network/Email/CakeEmail.php | 42 +++++++++---------- lib/Cake/Network/Email/MailTransport.php | 4 +- lib/Cake/Network/Email/SmtpTransport.php | 14 +++---- lib/Cake/View/Helper/FormHelper.php | 34 +++++++-------- lib/Cake/View/Helper/NumberHelper.php | 8 ++-- lib/Cake/View/Helper/PaginatorHelper.php | 2 +- lib/Cake/View/Helper/TimeHelper.php | 10 ++--- 12 files changed, 72 insertions(+), 72 deletions(-) diff --git a/app/webroot/test.php b/app/webroot/test.php index b6caa107f..e141912c3 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -84,7 +84,7 @@ if (!empty($failed)) { } if (Configure::read('debug') < 1) { - die(__d('cake', 'Debug setting does not allow access to this url.')); + die(__d('cake_dev', 'Debug setting does not allow access to this url.')); } require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; diff --git a/lib/Cake/Console/Templates/skel/webroot/test.php b/lib/Cake/Console/Templates/skel/webroot/test.php index 4931b069f..9c15c4171 100644 --- a/lib/Cake/Console/Templates/skel/webroot/test.php +++ b/lib/Cake/Console/Templates/skel/webroot/test.php @@ -81,7 +81,7 @@ if (!empty($failed)) { } if (Configure::read('debug') < 1) { - die(__d('cake', 'Debug setting does not allow access to this url.')); + die(__d('cake_dev', 'Debug setting does not allow access to this url.')); } require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php'; diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index b33cb5582..1de22094b 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -342,7 +342,7 @@ class AuthComponent extends Component { protected function _setDefaults() { $defaults = array( 'logoutRedirect' => $this->loginAction, - 'authError' => __d('cake', 'You are not authorized to access that location.') + 'authError' => __d('cake_dev', 'You are not authorized to access that location.') ); foreach ($defaults as $key => $value) { if (empty($this->{$key})) { diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index 84aaaad37..d032ce34e 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -125,7 +125,7 @@ class Scaffold { $this->ScaffoldModel = $this->controller->{$this->modelClass}; $this->scaffoldTitle = Inflector::humanize(Inflector::underscore($this->viewPath)); $this->scaffoldActions = $controller->scaffold; - $title_for_layout = __d('cake', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle; + $title_for_layout = __d('cake_dev', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle; $modelClass = $this->controller->modelClass; $primaryKey = $this->ScaffoldModel->primaryKey; $displayField = $this->ScaffoldModel->displayField; @@ -163,7 +163,7 @@ class Scaffold { $this->ScaffoldModel->id = $request->params['pass'][0]; } if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelKey))); + throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelKey))); } $this->ScaffoldModel->recursive = 1; $this->controller->request->data = $this->ScaffoldModel->read(); @@ -218,10 +218,10 @@ class Scaffold { */ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') { $formAction = 'edit'; - $success = __d('cake', 'updated'); + $success = __d('cake_dev', 'updated'); if ($action === 'add') { $formAction = 'add'; - $success = __d('cake', 'saved'); + $success = __d('cake_dev', 'saved'); } if ($this->controller->beforeScaffold($action)) { @@ -230,7 +230,7 @@ class Scaffold { $this->ScaffoldModel->id = $request['pass'][0]; } if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelKey))); + throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelKey))); } } @@ -241,7 +241,7 @@ class Scaffold { if ($this->ScaffoldModel->save($request->data)) { if ($this->controller->afterScaffoldSave($action)) { - $message = __d('cake', + $message = __d('cake_dev', 'The %1$s has been %2$s', Inflector::humanize($this->modelKey), $success @@ -252,7 +252,7 @@ class Scaffold { } } else { if ($this->_validSession) { - $this->controller->Session->setFlash(__d('cake', 'Please correct errors below.')); + $this->controller->Session->setFlash(__d('cake_dev', 'Please correct errors below.')); } } } @@ -300,13 +300,13 @@ class Scaffold { } $this->ScaffoldModel->id = $id; if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelClass))); + throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelClass))); } if ($this->ScaffoldModel->delete()) { - $message = __d('cake', 'The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id); + $message = __d('cake_dev', 'The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id); return $this->_sendMessage($message); } else { - $message = __d('cake', + $message = __d('cake_dev', 'There was an error deleting the %1$s with id: %2$d', Inflector::humanize($this->modelClass), $id diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 58a410d26..633c49913 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -204,7 +204,7 @@ class ExceptionRenderer { public function error400($error) { $message = $error->getMessage(); if (Configure::read('debug') == 0 && $error instanceof CakeException) { - $message = __d('cake', 'Not Found'); + $message = __('Not Found'); } $url = $this->controller->request->here(); $this->controller->response->statusCode($error->getCode()); @@ -227,7 +227,7 @@ class ExceptionRenderer { $code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500; $this->controller->response->statusCode($code); $this->controller->set(array( - 'name' => __d('cake', 'An Internal Error Has Occurred'), + 'name' => __('An Internal Error Has Occurred'), 'message' => h($url), 'error' => $error, )); diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index 89aa2a4cc..84220cd3c 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -295,7 +295,7 @@ class CakeEmail { if ($email === null) { return $this->_from; } - return $this->_setEmailSingle('_from', $email, $name, __d('cake', 'From requires only 1 email address.')); + return $this->_setEmailSingle('_from', $email, $name, __d('cake_dev', 'From requires only 1 email address.')); } /** @@ -310,7 +310,7 @@ class CakeEmail { if ($email === null) { return $this->_sender; } - return $this->_setEmailSingle('_sender', $email, $name, __d('cake', 'Sender requires only 1 email address.')); + return $this->_setEmailSingle('_sender', $email, $name, __d('cake_dev', 'Sender requires only 1 email address.')); } /** @@ -325,7 +325,7 @@ class CakeEmail { if ($email === null) { return $this->_replyTo; } - return $this->_setEmailSingle('_replyTo', $email, $name, __d('cake', 'Reply-To requires only 1 email address.')); + return $this->_setEmailSingle('_replyTo', $email, $name, __d('cake_dev', 'Reply-To requires only 1 email address.')); } /** @@ -340,7 +340,7 @@ class CakeEmail { if ($email === null) { return $this->_readReceipt; } - return $this->_setEmailSingle('_readReceipt', $email, $name, __d('cake', 'Disposition-Notification-To requires only 1 email address.')); + return $this->_setEmailSingle('_readReceipt', $email, $name, __d('cake_dev', 'Disposition-Notification-To requires only 1 email address.')); } /** @@ -355,7 +355,7 @@ class CakeEmail { if ($email === null) { return $this->_returnPath; } - return $this->_setEmailSingle('_returnPath', $email, $name, __d('cake', 'Return-Path requires only 1 email address.')); + return $this->_setEmailSingle('_returnPath', $email, $name, __d('cake_dev', 'Return-Path requires only 1 email address.')); } /** @@ -445,7 +445,7 @@ class CakeEmail { protected function _setEmail($varName, $email, $name) { if (!is_array($email)) { if (!Validation::email($email)) { - throw new SocketException(__d('cake', 'Invalid email: "%s"', $email)); + throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email)); } if ($name === null) { $name = $email; @@ -459,7 +459,7 @@ class CakeEmail { $key = $value; } if (!Validation::email($key)) { - throw new SocketException(__d('cake', 'Invalid email: "%s"', $key)); + throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $key)); } $list[$key] = $value; } @@ -499,7 +499,7 @@ class CakeEmail { protected function _addEmail($varName, $email, $name) { if (!is_array($email)) { if (!Validation::email($email)) { - throw new SocketException(__d('cake', 'Invalid email: "%s"', $email)); + throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email)); } if ($name === null) { $name = $email; @@ -513,7 +513,7 @@ class CakeEmail { $key = $value; } if (!Validation::email($key)) { - throw new SocketException(__d('cake', 'Invalid email: "%s"', $key)); + throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $key)); } $list[$key] = $value; } @@ -544,7 +544,7 @@ class CakeEmail { */ public function setHeaders($headers) { if (!is_array($headers)) { - throw new SocketException(__d('cake', '$headers should be an array.')); + throw new SocketException(__d('cake_dev', '$headers should be an array.')); } $this->_headers = $headers; return $this; @@ -559,7 +559,7 @@ class CakeEmail { */ public function addHeaders($headers) { if (!is_array($headers)) { - throw new SocketException(__d('cake', '$headers should be an array.')); + throw new SocketException(__d('cake_dev', '$headers should be an array.')); } $this->_headers = array_merge($this->_headers, $headers); return $this; @@ -744,7 +744,7 @@ class CakeEmail { return $this->_emailFormat; } if (!in_array($format, $this->_emailFormatAvailable)) { - throw new SocketException(__d('cake', 'Format not available.')); + throw new SocketException(__d('cake_dev', 'Format not available.')); } $this->_emailFormat = $format; return $this; @@ -779,9 +779,9 @@ class CakeEmail { $transportClassname .= 'Transport'; App::uses($transportClassname, $plugin . 'Network/Email'); if (!class_exists($transportClassname)) { - throw new SocketException(__d('cake', 'Class "%s" not found.', $transportClassname)); + throw new SocketException(__d('cake_dev', 'Class "%s" not found.', $transportClassname)); } elseif (!method_exists($transportClassname, 'send')) { - throw new SocketException(__d('cake', 'The "%s" do not have send method.', $transportClassname)); + throw new SocketException(__d('cake_dev', 'The "%s" do not have send method.', $transportClassname)); } return $this->_transportClass = new $transportClassname(); @@ -802,7 +802,7 @@ class CakeEmail { $this->_messageId = $message; } else { if (!preg_match('/^\<.+@.+\>$/', $message)) { - throw new SocketException(__d('cake', 'Invalid format to Message-ID. The text should be something like ""')); + throw new SocketException(__d('cake_dev', 'Invalid format to Message-ID. The text should be something like ""')); } $this->_messageId = $message; } @@ -826,11 +826,11 @@ class CakeEmail { $fileInfo = array('file' => $fileInfo); } if (!isset($fileInfo['file'])) { - throw new SocketException(__d('cake', 'File not specified.')); + throw new SocketException(__d('cake_dev', 'File not specified.')); } $fileInfo['file'] = realpath($fileInfo['file']); if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) { - throw new SocketException(__d('cake', 'File not found: "%s"', $fileInfo['file'])); + throw new SocketException(__d('cake_dev', 'File not found: "%s"', $fileInfo['file'])); } if (is_int($name)) { $name = basename($fileInfo['file']); @@ -900,10 +900,10 @@ class CakeEmail { */ public function send($content = null) { if (empty($this->_from)) { - throw new SocketException(__d('cake', 'From is not specified.')); + throw new SocketException(__d('cake_dev', 'From is not specified.')); } if (empty($this->_to) && empty($this->_cc) && empty($this->_bcc)) { - throw new SocketException(__d('cake', 'You need specify one destination on to, cc or bcc.')); + throw new SocketException(__d('cake_dev', 'You need specify one destination on to, cc or bcc.')); } if (is_array($content)) { @@ -994,11 +994,11 @@ class CakeEmail { protected function _applyConfig($config) { if (is_string($config)) { if (!class_exists('EmailConfig') && !config('email')) { - throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . DS . 'email.php')); + throw new SocketException(__d('cake_dev', '%s not found.', APP . 'Config' . DS . 'email.php')); } $configs = new EmailConfig(); if (!isset($configs->{$config})) { - throw new SocketException(__d('cake', 'Unknown email configuration "%s".', $config)); + throw new SocketException(__d('cake_dev', 'Unknown email configuration "%s".', $config)); } $config = $configs->{$config}; } diff --git a/lib/Cake/Network/Email/MailTransport.php b/lib/Cake/Network/Email/MailTransport.php index c1682626e..e97d0e372 100644 --- a/lib/Cake/Network/Email/MailTransport.php +++ b/lib/Cake/Network/Email/MailTransport.php @@ -42,10 +42,10 @@ class MailTransport extends AbstractTransport { $message = implode($eol, $email->message()); if (ini_get('safe_mode') || !isset($this->_config['additionalParameters'])) { if (!@mail($to, $email->subject(), $message, $headers)) { - throw new SocketException(__d('cake', 'Could not send email.')); + throw new SocketException(__d('cake_dev', 'Could not send email.')); } } elseif (!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) { - throw new SocketException(__d('cake', 'Could not send email.')); + throw new SocketException(__d('cake_dev', 'Could not send email.')); } return array('headers' => $headers, 'message' => $message); } diff --git a/lib/Cake/Network/Email/SmtpTransport.php b/lib/Cake/Network/Email/SmtpTransport.php index f16cfed3e..b1d9d9236 100644 --- a/lib/Cake/Network/Email/SmtpTransport.php +++ b/lib/Cake/Network/Email/SmtpTransport.php @@ -92,7 +92,7 @@ class SmtpTransport extends AbstractTransport { protected function _connect() { $this->_generateSocket(); if (!$this->_socket->connect()) { - throw new SocketException(__d('cake', 'Unable to connect in SMTP server.')); + throw new SocketException(__d('cake_dev', 'Unable to connect to SMTP server.')); } $this->_smtpSend(null, '220'); @@ -110,7 +110,7 @@ class SmtpTransport extends AbstractTransport { try { $this->_smtpSend("HELO {$host}", '250'); } catch (SocketException $e2) { - throw new SocketException(__d('cake', 'SMTP server not accepted the connection.')); + throw new SocketException(__d('cake_dev', 'SMTP server did not accept the connection.')); } } } @@ -126,13 +126,13 @@ class SmtpTransport extends AbstractTransport { $authRequired = $this->_smtpSend('AUTH LOGIN', '334|503'); if ($authRequired == '334') { if (!$this->_smtpSend(base64_encode($this->_config['username']), '334')) { - throw new SocketException(__d('cake', 'SMTP server not accepted the username.')); + throw new SocketException(__d('cake_dev', 'SMTP server did not accept the username.')); } if (!$this->_smtpSend(base64_encode($this->_config['password']), '235')) { - throw new SocketException(__d('cake', 'SMTP server not accepted the password.')); + throw new SocketException(__d('cake_dev', 'SMTP server did not accept the password.')); } } elseif ($authRequired != '503') { - throw new SocketException(__d('cake', 'SMTP do not require authentication.')); + throw new SocketException(__d('cake_dev', 'SMTP does not require authentication.')); } } } @@ -212,7 +212,7 @@ class SmtpTransport extends AbstractTransport { $response .= $this->_socket->read(); } if (substr($response, -2) !== "\r\n") { - throw new SocketException(__d('cake', 'SMTP timeout.')); + throw new SocketException(__d('cake_dev', 'SMTP timeout.')); } $response = end(explode("\r\n", rtrim($response, "\r\n"))); @@ -222,7 +222,7 @@ class SmtpTransport extends AbstractTransport { } return $code[1]; } - throw new SocketException(__d('cake', 'SMTP Error: %s', $response)); + throw new SocketException(__d('cake_dev', 'SMTP Error: %s', $response)); } } diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 13b84d6c3..3f8735e89 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -683,7 +683,7 @@ class FormHelper extends AppHelper { if (is_array($error)) { foreach ($error as &$e) { if (is_numeric($e)) { - $e = __d('cake', 'Error in field %s', Inflector::humanize($this->field())); + $e = __('Error in field %s', Inflector::humanize($this->field())); } } } @@ -752,7 +752,7 @@ class FormHelper extends AppHelper { if (substr($text, -3) == '_id') { $text = substr($text, 0, strlen($text) - 3); } - $text = __d('cake', Inflector::humanize(Inflector::underscore($text))); + $text = __(Inflector::humanize(Inflector::underscore($text))); } if (is_string($options)) { @@ -821,13 +821,13 @@ class FormHelper extends AppHelper { } if ($legend === true) { - $actionName = __d('cake', 'New %s'); + $actionName = __('New %s'); $isEdit = ( strpos($this->request->params['action'], 'update') !== false || strpos($this->request->params['action'], 'edit') !== false ); if ($isEdit) { - $actionName = __d('cake', 'Edit %s'); + $actionName = __('Edit %s'); } $modelName = Inflector::humanize(Inflector::underscore($model)); $legend = sprintf($actionName, __($modelName)); @@ -1582,7 +1582,7 @@ class FormHelper extends AppHelper { */ public function submit($caption = null, $options = array()) { if (!is_string($caption) && empty($caption)) { - $caption = __d('cake', 'Submit'); + $caption = __('Submit'); } $out = null; $div = true; @@ -2434,18 +2434,18 @@ class FormHelper extends AppHelper { break; case 'month': if ($options['monthNames'] === true) { - $data['01'] = __d('cake', 'January'); - $data['02'] = __d('cake', 'February'); - $data['03'] = __d('cake', 'March'); - $data['04'] = __d('cake', 'April'); - $data['05'] = __d('cake', 'May'); - $data['06'] = __d('cake', 'June'); - $data['07'] = __d('cake', 'July'); - $data['08'] = __d('cake', 'August'); - $data['09'] = __d('cake', 'September'); - $data['10'] = __d('cake', 'October'); - $data['11'] = __d('cake', 'November'); - $data['12'] = __d('cake', 'December'); + $data['01'] = __('January'); + $data['02'] = __('February'); + $data['03'] = __('March'); + $data['04'] = __('April'); + $data['05'] = __('May'); + $data['06'] = __('June'); + $data['07'] = __('July'); + $data['08'] = __('August'); + $data['09'] = __('September'); + $data['10'] = __('October'); + $data['11'] = __('November'); + $data['12'] = __('December'); } else if (is_array($options['monthNames'])) { $data = $options['monthNames']; } else { diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index 7adcc9e59..a5dacda6e 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -86,13 +86,13 @@ class NumberHelper extends AppHelper { case $size < 1024: return __dn('cake', '%d Byte', '%d Bytes', $size, $size); case round($size / 1024) < 1024: - return __d('cake', '%d KB', $this->precision($size / 1024, 0)); + return __('%d KB', $this->precision($size / 1024, 0)); case round($size / 1024 / 1024, 2) < 1024: - return __d('cake', '%.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 __d('cake', '%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2)); + return __('%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2)); default: - return __d('cake', '%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); + return __('%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); } } diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index 07fbc0258..6603f4418 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -557,7 +557,7 @@ class PaginatorHelper extends AppHelper { array( 'model' => $this->defaultModel(), 'format' => 'pages', - 'separator' => __d('cake', ' of ') + 'separator' => __(' of ') ), $options); diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index bfa2101cf..ecba65e94 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -260,9 +260,9 @@ class TimeHelper extends AppHelper { $y = $this->isThisYear($date) ? '' : ' %Y'; if ($this->isToday($dateString, $userOffset)) { - $ret = __d('cake', 'Today, %s', strftime("%H:%M", $date)); + $ret = __('Today, %s', strftime("%H:%M", $date)); } elseif ($this->wasYesterday($dateString, $userOffset)) { - $ret = __d('cake', '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); @@ -609,7 +609,7 @@ class TimeHelper extends AppHelper { $diff = $futureTime - $pastTime; if ($diff > abs($now - $this->fromString($end))) { - $relativeDate = __d('cake', 'on %s', date($format, $inSeconds)); + $relativeDate = __('on %s', date($format, $inSeconds)); } else { if ($years > 0) { // years and months and days @@ -643,7 +643,7 @@ class TimeHelper extends AppHelper { } if (!$backwards) { - $relativeDate = __d('cake', '%s ago', $relativeDate); + $relativeDate = __('%s ago', $relativeDate); } } return $relativeDate; @@ -662,7 +662,7 @@ class TimeHelper extends AppHelper { public function wasWithinLast($timeInterval, $dateString, $userOffset = null) { $tmp = str_replace(' ', '', $timeInterval); if (is_numeric($tmp)) { - $timeInterval = $tmp . ' ' . __d('cake', 'days'); + $timeInterval = $tmp . ' ' . __('days'); } $date = $this->fromString($dateString, $userOffset);