#105523LocalizationUtility never displays default value if TypoScript overrides exist
Description
Situation
There is a bug in LocalizationUtility->translate() in v12 and v13
https://github.com/TYPO3/typo3/blob/12.4/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php#L82
https://github.com/TYPO3/typo3/blob/13.4/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php#L78
It checks if TypoScript overrides exist and if there are ANY overrides for the current $languageKey the $value is set to an empty string.
$overrideLabels = static::loadTypoScriptLabels($extensionName);
$languageKey = $locale->getName();
// @todo: probably cannot handle "de-DE" and "de" fallbacks
if ($value === null && isset($overrideLabels[$languageKey])) {
$value = '';
}
This prevents the TranslateViewHelper from returning the default value:
if ($value === null) {
return self::handleDefaultValue($default, $translateArguments);
}
Fix
Check if the actually requested $key is set in the $overrideLabels instead.