Permalink
Browse files

Fixing i18n extraction errors in Scaffold. Fixes #1305

  • Loading branch information...
1 parent bf10723 commit d0d16a7edaa9a3b26f6a64c7bbaf9f50f0f7d1f2 @markstory markstory committed Nov 23, 2010
Showing with 14 additions and 12 deletions.
  1. +14 −12 cake/libs/controller/scaffold.php
@@ -303,7 +303,7 @@ function __scaffoldSave($params = array(), $action = 'edit') {
}
if (!$this->ScaffoldModel->exists()) {
- $message = __(sprintf("Invalid id for %s::edit()", Inflector::humanize($this->modelKey), true));
+ $message = sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey));
if ($this->_validSession) {
$this->controller->Session->setFlash($message);
$this->controller->redirect($this->redirect);
@@ -321,9 +321,10 @@ function __scaffoldSave($params = array(), $action = 'edit') {
if ($this->ScaffoldModel->save($this->controller->data)) {
if ($this->controller->_afterScaffoldSave($action)) {
- $message = __(
- sprintf('The %1$s has been %2$s', Inflector::humanize($this->modelKey), $success),
- true
+ $message = sprintf(
+ __('The %1$s has been %2$s', true),
+ Inflector::humanize($this->modelKey),
+ $success
);
if ($this->_validSession) {
$this->controller->Session->setFlash($message);
@@ -376,8 +377,9 @@ function __scaffoldSave($params = array(), $action = 'edit') {
*/
function __scaffoldDelete($params = array()) {
if ($this->controller->_beforeScaffold('delete')) {
- $message = __(
- sprintf("No id set for %s::delete()", Inflector::humanize($this->modelKey)), true
+ $message = sprintf(
+ __("No id set for %s::delete()", true),
+ Inflector::humanize($this->modelKey)
);
if (isset($params['pass'][0])) {
$id = $params['pass'][0];
@@ -390,9 +392,9 @@ function __scaffoldDelete($params = array()) {
}
if ($this->ScaffoldModel->delete($id)) {
- $message = __(
- sprintf('The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id),
- true
+ $message = sprintf(
+ __('The %1$s with id: %2$d has been deleted.', true),
+ Inflector::humanize($this->modelClass), $id
);
if ($this->_validSession) {
$this->controller->Session->setFlash($message);
@@ -402,10 +404,10 @@ function __scaffoldDelete($params = array()) {
return $this->_output();
}
} else {
- $message = __(sprintf(
- 'There was an error deleting the %1$s with id: %2$d',
+ $message = sprintf(
+ __('There was an error deleting the %1$s with id: %2$d', true),
Inflector::humanize($this->modelClass), $id
- ), true);
+ );
if ($this->_validSession) {
$this->controller->Session->setFlash($message);
$this->controller->redirect($this->redirect);

0 comments on commit d0d16a7

Please sign in to comment.