Project

General

Profile

Actions

Bug #103505

open

Overriding locallang labels from TypoScript does not work as expected

Added by Andreas Kiessling about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2024-03-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The changes from https://github.com/TYPO3/typo3/commit/26bccb635f297f9b0300899557d922bc677f81a5 with // Populate the initial values with default, if no labels for the current language are given are buggy

Example:
Back link in EXT:news with German labels installed outputs Zurück

<f:translate key="back-link" />

Now override the default label with

plugin.tx_news._LOCAL_LANG.default.back-link = Back to list

Expected result:
default: Back to list
German: Zurück

Actual result:
default: Back to list
German: Back to list

This should NOT change the german translation like in previous versions.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #103130: LocalizationUtility does not load translations correctly if TypoScript overrides existUnder ReviewMarkus Klein2024-02-15

Actions
Actions #1

Updated by Markus Klein about 1 month ago

Duplicate of #103130 ?

Actions #2

Updated by Markus Klein about 1 month ago

  • Related to Bug #103130: LocalizationUtility does not load translations correctly if TypoScript overrides exist added
Actions #3

Updated by Andreas Kiessling about 1 month ago

I initially had a look at your patch, but the code was moved and refactored for v12.
Your problem is, that first default is requested which builds up a cache and then DE is requested? In my case only DE labels are requested, but the overlay from TS is wrong.

My problem seems to be in

https://github.com/TYPO3/typo3/blob/b1bde78f4ac371cfc10bbc8ee868603f1fdc06d7/typo3/sysext/core/Classes/Localization/LanguageService.php#L274

When i remove these lines it looks ok for my project.

if (!isset($localLanguage[$mainLanguageKey])) {
  $localLanguage[$mainLanguageKey] = $localLanguage['default'];
}

Actions #4

Updated by Markus Klein about 1 month ago · Edited

I noticed that all tests regarding TypoScript overriding had been removed. :(-

I looked at the wrong file.

Actions

Also available in: Atom PDF