[TYPO3-core] RFC #12650: Labels for calcAge: Singular/Plural

Bernhard Kraft kraftb at think-open.at
Thu May 6 09:47:39 CEST 2010


Steffen Kamper wrote:

> the patch shows the strange thing that labels are passed as param. Why 
> don't we simple don't use this parameter and fetch the core label for 
> ages in function, setting label param to deprecated? Would make more 
> sense to use

This is absolutely not strange. The method "calcAge" gets called from within stdWrap:

if ($conf['age']) {
	$content = $this->calcAge($GLOBALS['EXEC_TIME'] - $content, conf['age']);
}

So if I remove the second parameter it would not be possible to set the "age" labels
from within TypoScript. This would break compatibility. Please note that this is about
the FE calcAge and not about the BE calcAge. Anyways it seems a bad idea to me to have
the same code twice: in class.tslib_content.php and class.t3lib_befunc.php, but this
is another story.

I think removing the second parameter $conf['age'] from the call within stdWrap is not
a very clever idea, as it would not be possible to set locallang-labels like
"labels.minutesHoursDaysYears" from within TypoScript because of the "." (dot). And
AFAIK one cannot override core LL-Labels.

So having the last parameter is mandatory in my eyes.



greets,
Bernhard


More information about the TYPO3-team-core mailing list