Applying patch from 'mete0r' to make the legend generated FormHelper::inputs() more i18n friendly. Fixes #6360

This commit is contained in:
mark_story 2009-08-27 22:38:49 -04:00
parent 7c4d60abe8
commit 4bb5b615f7

View file

@ -528,16 +528,16 @@ class FormHelper extends AppHelper {
}
if ($legend === true) {
$actionName = __('New', true);
$actionName = __('New %s', true);
$isEdit = (
strpos($this->action, 'update') !== false ||
strpos($this->action, 'edit') !== false
);
if ($isEdit) {
$actionName = __('Edit', true);
$actionName = __('Edit %s', true);
}
$modelName = Inflector::humanize(Inflector::underscore($this->model()));
$legend = $actionName .' '. __($modelName, true);
$legend = sprintf($actionName, __($modelName, true));
}
$out = null;