Project

General

Profile

Actions

Bug #63755

closed

LocalizationUtility and $extensionName

Added by Tomasz Krawczyk almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Code Cleanup
Target version:
-
Start date:
2014-12-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Markus Klein almost 10 years ago

  • Status changed from New to Needs Feedback

Where do you "define" the extension name?

Actions #2

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.

Actions #3

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

Actions #4

Updated by Tomasz Krawczyk almost 10 years ago

Oh. Now I understand. I was using $extensionName = 'Mobile Detecotr'.

Thanks!

The bug may be closed.

Actions #5

Updated by Wouter Wolters almost 10 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF