[TASK] Add TYPO3 10 compatibilty getTranslation function in TcaUtility
This commit is contained in:
parent
3c9a649822
commit
06010aebea
@ -13,6 +13,8 @@ namespace Cjel\TemplatesAide\Utility;
|
||||
***/
|
||||
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -87,6 +89,17 @@ class TcaUtility
|
||||
*/
|
||||
public static function getTranslation($key, $extensionKey)
|
||||
{
|
||||
if (version_compare(TYPO3_branch, '10.0', '>=')) {
|
||||
if (!$extensionKey) {
|
||||
$extensionKey = 'site_templates';
|
||||
}
|
||||
return implode([
|
||||
'LLL:EXT:',
|
||||
$extensionKey,
|
||||
'/Resources/Private/Language/locallang_db.xlf:',
|
||||
$key
|
||||
]);
|
||||
} else {
|
||||
if ($extensionKey) {
|
||||
$translation = LocalizationUtility::translate(
|
||||
$key,
|
||||
@ -106,3 +119,4 @@ class TcaUtility
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user