Project

General

Profile

Actions

Bug #98647

closed

translate viewhelper always shows default with extensionName and key/id

Added by Gregor Hermens over 1 year ago. Updated about 1 year ago.

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #96473: Allow ServerRequestInterface in ext:fluidClosed2022-01-06

Actions
Actions #1

Updated by Oliver Bartsch about 1 year ago

  • Related to Task #96473: Allow ServerRequestInterface in ext:fluid added
Actions #2

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78789

Actions #3

Updated by Oliver Bartsch about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF