Fixing i18n extraction errors in Scaffold. Fixes #1305

This commit is contained in:
mark_story 2010-11-22 21:29:11 -05:00
parent bf10723f89
commit d0d16a7eda

View file

@ -303,7 +303,7 @@ class Scaffold extends Object {
}
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 @@ class Scaffold extends Object {
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 @@ class Scaffold extends Object {
*/
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 @@ class Scaffold extends Object {
}
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 @@ class Scaffold extends Object {
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);