Skip to content
Permalink
Browse files

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
  • Loading branch information...
markstory committed Oct 15, 2011
1 parent 4adc042 commit 6bf6d799793ffe0dd0da8b6965dabd587d572d0f
@@ -84,7 +84,7 @@
}
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';
@@ -81,7 +81,7 @@
}
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';
@@ -342,7 +342,7 @@ public function startup($controller) {
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})) {
@@ -125,7 +125,7 @@ public function __construct(Controller $controller, CakeRequest $request) {
$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 @@ protected function _scaffoldView(CakeRequest $request) {
$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 @@ protected function _scaffoldForm($action = 'edit') {
*/
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 @@ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
$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 @@ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
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 @@ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
}
} 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 @@ protected function _scaffoldDelete(CakeRequest $request) {
}
$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
@@ -204,7 +204,7 @@ protected function _cakeError(CakeException $error) {
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 @@ public function error500($error) {
$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,
));
@@ -295,7 +295,7 @@ public function from($email = null, $name = null) {
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 @@ public function sender($email = null, $name = null) {
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 @@ public function replyTo($email = null, $name = null) {
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 @@ public function readReceipt($email = null, $name = null) {
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 @@ public function returnPath($email = null, $name = null) {
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 @@ public function addBcc($email, $name = null) {
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 @@ protected function _setEmail($varName, $email, $name) {
$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 @@ protected function _setEmailSingle($varName, $email, $name, $throwMessage) {
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 @@ protected function _addEmail($varName, $email, $name) {
$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 @@ public function subject($subject = null) {
*/
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 @@ public function setHeaders($headers) {
*/
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 @@ public function emailFormat($format = null) {
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 @@ public function transportClass() {
$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 @@ public function messageId($message = null) {
$this->_messageId = $message;
} else {
if (!preg_match('/^\<.+@.+\>$/', $message)) {
throw new SocketException(__d('cake', 'Invalid format to Message-ID. The text should be something like "<uuid@server.com>"'));
throw new SocketException(__d('cake_dev', 'Invalid format to Message-ID. The text should be something like "<uuid@server.com>"'));
}
$this->_messageId = $message;
}
@@ -826,11 +826,11 @@ public function attachments($attachments = null) {
$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 @@ public function config($config = null) {
*/
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 @@ public static function deliver($to = null, $subject = null, $message = null, $tr
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};
}
@@ -42,10 +42,10 @@ public function send(CakeEmail $email) {
$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);
}
@@ -92,7 +92,7 @@ public function config($config = array()) {
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 @@ protected function _connect() {
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 @@ protected function _auth() {
$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 @@ protected function _smtpSend($data, $checkCode = '250') {
$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 @@ protected function _smtpSend($data, $checkCode = '250') {
}
return $code[1];
}
throw new SocketException(__d('cake', 'SMTP Error: %s', $response));
throw new SocketException(__d('cake_dev', 'SMTP Error: %s', $response));
}
}
Oops, something went wrong.

0 comments on commit 6bf6d79

Please sign in to comment.
You can’t perform that action at this time.