mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating formHelper label to only translate text if the default is used, closes #2314
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6184 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ac4896fabd
commit
87b33dc12a
1 changed files with 8 additions and 6 deletions
|
@ -408,6 +408,10 @@ class FormHelper extends AppHelper {
|
|||
$text = substr($text, 0, strlen($text) - 3);
|
||||
}
|
||||
$text = Inflector::humanize(Inflector::underscore($text));
|
||||
|
||||
if (!empty($text)) {
|
||||
$text = __($text, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($attributes['for'])) {
|
||||
|
@ -416,9 +420,7 @@ class FormHelper extends AppHelper {
|
|||
} else {
|
||||
$labelFor = $this->domId($fieldName);
|
||||
}
|
||||
if (!empty($text)) {
|
||||
$text = __($text, true);
|
||||
}
|
||||
|
||||
return $this->output(sprintf($this->Html->tags['label'], $labelFor, $this->_parseAttributes($attributes), $text));
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue