Skip to content

Commit

Permalink
Fixing i18n extraction errors in Scaffold. Fixes #1305
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 23, 2010
1 parent bf10723 commit d0d16a7
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions cake/libs/controller/scaffold.php
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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];
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d0d16a7

Please sign in to comment.