Actions
Bug #98647
closedtranslate viewhelper always shows default with extensionName and key/id
Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2022-10-18
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
When using the translate viewhelper with parameters extensionName, key/id and default, instead of the translation the default value is shown, ie:
{f:translate(key: 'someKey', extensionName: 'SomeExtensionName', default: 'defaultValue')}
Actual result: defaultValue
Expected result: translation of id 'someKey' in current language
Default should only be a fallback if id 'someKey' is not defined in current and default language.
In file EXT:cms-fluid/Classes/ViewHelpers/TranslateViewHelper.php line 159-171, extensionName and key/id are transformed to 'LLL:EXT:' syntax only if default is empty.
In line 174, $value is set to id because of the missing 'LLL:'.
In line 175-179, $value is set to default.
Possible solution: Remove the check for empty default from line 159.
Actions