mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Applying patch from 'mete0r' to make the legend generated FormHelper::inputs() more i18n friendly. Fixes #6360
This commit is contained in:
parent
7c4d60abe8
commit
4bb5b615f7
1 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue