Bug #63755
closedLocalizationUtility and $extensionName
0%
Description
Class \TYPO3\CMS\Extbase\Utility\LocalizationUtility uses variable $extensionName in a few places. I think that variable should be called $extensionKey.
F.e. method initializeLocalization contains such line:
$locallangPathAndFilename = 'EXT:' . \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($extensionName) . '/' . self::$locallangPath . 'locallang.xml';
In case of my extension "Mobile Detector" (key: "tk_mobiledetector") name $extensionName leads to errors. Because
$locallangPathAndFilename = 'EXT:mobile detector/Resources/Private/Language/locallang.xml';
where path doesn't exist.
Updated by Markus Klein almost 10 years ago
- Status changed from New to Needs Feedback
Where do you "define" the extension name?
Updated by Tomasz Krawczyk almost 10 years ago
Extension name is already defined in my extension.
When I use localized strings in my extension I use something like this:
LocalizationUtility::translate('too_small_device', $this->extKey);
Second parameted of the method \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate() is $extensionName but should be $extensionKey.
Updated by Markus Klein almost 10 years ago
The extension name is always in UpperCamelCase throughout extbase. This is NOT the extKey.
It is the second part in your namespace. (e.g. \Company\ExtensionName\SomeClass)
In your case the extension name should be TkMobiledetector
Updated by Tomasz Krawczyk almost 10 years ago
Oh. Now I understand. I was using $extensionName = 'Mobile Detecotr'.
Thanks!
The bug may be closed.
Updated by Wouter Wolters almost 10 years ago
- Status changed from Needs Feedback to Closed