Bug #61830

Localization of file references broken

Added by Franz Koch about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-09-24
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The LocalizationUtility from Extbase is using $GLOBALS['TSFE']->sL to translate translateFileReference passed to it, but this is no longer available and thus these translations fail. Removing the FE special case and using $GLOBALS['LANG'] instead.

Before:

static protected function translateFileReference($key) {
    if (TYPO3_MODE === 'FE') {
        $value = $GLOBALS['TSFE']->sL($key);
        return $value !== FALSE ? $value : NULL;
    } elseif (is_object($GLOBALS['LANG'])) {
        $value = $GLOBALS['LANG']->sL($key);
        return $value !== '' ? $value : NULL;
    } else {
        return $key;
    }
}

after:

static protected function translateFileReference($key) {
    if (is_object($GLOBALS['LANG'])) {
        $value = $GLOBALS['LANG']->sL($key);
        return $value !== '' ? $value : NULL;
    } else {
        return $key;
    }
}

History

#1 Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32950

#2 Updated by Markus Klein about 5 years ago

What am I missing? Why should $GLOBALS['TSFE']->sL() not be available?

#3 Updated by Franz Koch about 5 years ago

argh, sorry, my bad. I should have slept instead of working until 5am. I was working on an eID script that triggers Extbase and even though I had set the language to "de" labels with file references did not get translated. Then I went in for a debug session (half asleep) and tested and searched bullshit which made me think ->sL is not available/working anymore. And after removing the 'FE' path from the TranslationUtility and using $GLOBALS['LANG'] the labels where correctly translated.
So there seems to be some other issue in my eID bootstrap - sorry for the noise.

Can somebody please close this thing?

#4 Updated by Markus Klein about 5 years ago

  • Status changed from Under Review to Closed
  • Target version deleted (next-patchlevel)

Also available in: Atom PDF