‪TYPO3CMS  9.5
TYPO3\CMS\Core\Localization\LanguageService Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\LanguageService:
TYPO3\CMS\Lang\LanguageService

Public Member Functions

 __construct ()
 
 init ($languageKey)
 
string debugLL ($value)
 
string getLL ($index)
 
string getLLL ($index, $localLanguage)
 
string sL ($input)
 
 loadSingleTableDescription ($table)
 
mixed includeLLFile ($fileRef, $setGlobal=true, $mergeLocalOntoDefault=false)
 
array getLabelsWithPrefix ($prefix, $strip='')
 

Public Attributes

string $lang = 'default'
 
bool $debugKey = false
 
array $LL_files_cache = array( )
 
array $LL_labels_cache = array( )
 

Protected Member Functions

array readLLfile ($fileRef)
 

Protected Attributes

array $languageDependencies = array( )
 
array $languageFileCache = array( )
 

Detailed Description

Contains the TYPO3 Backend Language class For detailed information about how localization is handled, please refer to the 'Inside TYPO3' document which describes this. This class is normally instantiated as the global variable $GLOBALS['LANG'] It's only available in the backend and under certain circumstances in the frontend

See also
‪\TYPO3\CMS\Backend\Template\DocumentTemplate

Definition at line 28 of file LanguageService.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Localization\LanguageService::__construct ( )

LanguageService constructor.

Definition at line 70 of file LanguageService.php.

References $GLOBALS.

Member Function Documentation

◆ debugLL()

string TYPO3\CMS\Core\Localization\LanguageService::debugLL (   $value)

Debugs localization key.

Parameters
string$value‪value to debug
Returns
‪string

Definition at line 106 of file LanguageService.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageService\getLLL(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

◆ getLabelsWithPrefix()

array TYPO3\CMS\Core\Localization\LanguageService::getLabelsWithPrefix (   $prefix,
  $strip = '' 
)

Gets labels with a specific fetched from the current locallang file. This is useful for e.g gathering javascript labels.

Parameters
string$prefix‪Prefix to select the correct labels
string$strip‪Sub-prefix to be removed from label names in the result
Returns
‪array Processed labels

Definition at line 335 of file LanguageService.php.

References $GLOBALS.

◆ getLL()

string TYPO3\CMS\Core\Localization\LanguageService::getLL (   $index)

Returns the label with key $index from the globally loaded $LOCAL_LANG array. Mostly used from modules with only one LOCAL_LANG file loaded into the global space.

Parameters
string$index‪Label key
Returns
‪string

Definition at line 118 of file LanguageService.php.

References $GLOBALS, and TYPO3\CMS\Core\Localization\LanguageService\getLLL().

Referenced by TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler\canHandleLink(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\checkScreenAction(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\createTemplate(), TYPO3\CMS\Impexp\Controller\ImportExportController\exportData(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getAdminAccountStatus(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getCreatedDirectoriesWorldWritableStatus(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getCreatedFilesWorldWritableStatus(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getEncryptedConnectionStatus(), TYPO3\CMS\Linkvalidator\Linktype\FileLinktype\getErrorMessage(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getFileDenyPatternStatus(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getHtaccessUploadStatus(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getLockSslStatus(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getMemcachedConnectionStatus(), TYPO3\CMS\Reports\Report\Status\FalStatus\getMissingFilesStatus(), TYPO3\CMS\Reports\Report\Status\SystemStatus\getMissingPhpModulesOfExtensions(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\getModuleContent(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getMysqlDatabaseUtf8Status(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getReferenceIndexStatus(), TYPO3\CMS\Reports\Report\Status\Typo3Status\getRegisteredXclassStatus(), TYPO3\CMS\Reports\Report\Status\Status\getReport(), TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider\getSystemLanguages(), TYPO3\CMS\Backend\View\PageLayoutView\getTable_tt_content(), TYPO3\CMS\Backend\Controller\Wizard\TableController\getTableWizard(), TYPO3\CMS\Linkvalidator\Linktype\LinkHandler\getTranslatedErrorMessage(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getTrustedHostsPatternStatus(), TYPO3\CMS\Backend\Controller\PageLayoutController\initActions(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\listTasksAction(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\mainAction(), TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList\makeControl(), TYPO3\CMS\Backend\Controller\LoginController\makeInterfaceSelector(), TYPO3\CMS\Backend\Controller\PageLayoutController\renderContent(), TYPO3\CMS\Reports\Task\SystemStatusUpdateTask\sendNotificationEmail(), TYPO3\CMS\Reports\Report\Status\Status\sortStatusProviders(), TYPO3\CMS\Backend\View\PageLayoutView\tt_content_drawHeader(), and TYPO3\CMS\Backend\View\PageLayoutView\tt_content_drawItem().

◆ getLLL()

string TYPO3\CMS\Core\Localization\LanguageService::getLLL (   $index,
  $localLanguage 
)

Returns the label with key $index from the $LOCAL_LANG array used as the second argument

Parameters
string$index‪Label key
array$localLanguage‪$LOCAL_LANG array to get label key from
Returns
‪string

Definition at line 130 of file LanguageService.php.

References TYPO3\CMS\Core\Localization\LanguageService\$lang, and TYPO3\CMS\Core\Localization\LanguageService\debugLL().

Referenced by TYPO3\CMS\Core\Localization\LanguageService\getLL(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

◆ includeLLFile()

mixed TYPO3\CMS\Core\Localization\LanguageService::includeLLFile (   $fileRef,
  $setGlobal = true,
  $mergeLocalOntoDefault = false 
)

Includes locallang file (and possibly additional localized version if configured for) Read language labels will be merged with $LOCAL_LANG (if $setGlobal = TRUE).

Parameters
string$fileRef‪$fileRef is a file-reference
bool$setGlobal‪Setting in global variable $LOCAL_LANG (or returning the variable)
bool$mergeLocalOntoDefault
Returns
‪mixed if $setGlobal===TRUE, LL-files set $LOCAL_LANG in global scope, or array is returned from function

Definition at line 260 of file LanguageService.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule(), and TYPO3\CMS\Core\Localization\LanguageService\readLLfile().

Referenced by TYPO3\CMS\Backend\Controller\ContextMenuController\__construct(), TYPO3\CMS\Reports\Report\Status\Status\__construct(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\__construct(), TYPO3\CMS\Redirects\Controller\ManagementController\__construct(), TYPO3\CMS\Backend\Controller\Wizard\ListController\__construct(), TYPO3\CMS\Backend\Controller\Wizard\EditController\__construct(), TYPO3\CMS\Backend\Controller\File\FileUploadController\__construct(), TYPO3\CMS\Linkvalidator\LinkAnalyzer\__construct(), TYPO3\CMS\Backend\Controller\LoginController\__construct(), TYPO3\CMS\Backend\Controller\Wizard\AddController\__construct(), TYPO3\CMS\Backend\Controller\ContentElement\MoveElementController\__construct(), TYPO3\CMS\Backend\Controller\BackendController\__construct(), TYPO3\CMS\Backend\Controller\Wizard\TableController\__construct(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\__construct(), TYPO3\CMS\Backend\Controller\NewRecordController\__construct(), TYPO3\CMS\Taskcenter\Controller\TaskModuleController\__construct(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\__construct(), TYPO3\CMS\Recordlist\Controller\RecordListController\__construct(), TYPO3\CMS\Backend\Controller\EditDocumentController\__construct(), TYPO3\CMS\Reports\Report\Status\WarningMessagePostProcessor\displayWarningMessages_postProcess(), TYPO3\CMS\Backend\FrontendBackendUserAuthentication\extGetLL(), TYPO3\CMS\Adminpanel\Modules\Debug\QueryInformation\getContent(), TYPO3\CMS\Recordlist\Controller\ElementBrowserController\init(), TYPO3\CMS\Info\Controller\PageInformationController\init(), TYPO3\CMS\Tstemplate\Controller\TemplateAnalyzerModuleFunctionController\init(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController\init(), TYPO3\CMS\Info\Controller\TranslationStatusController\init(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController\init(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController\init(), TYPO3\CMS\Recordlist\Controller\AbstractLinkBrowserController\init(), TYPO3\CMS\Backend\Module\AbstractFunctionModule\init(), TYPO3\CMS\Backend\Controller\PageLayoutController\init(), TYPO3\CMS\Filelist\Controller\FileListController\initializeObject(), TYPO3\CMS\Core\Localization\LanguageService\loadSingleTableDescription(), TYPO3\CMS\Linkvalidator\Report\LinkValidatorReport\main(), TYPO3\CMS\Lowlevel\Controller\DatabaseIntegrityController\mainAction(), TYPO3\CMS\Backend\Tree\View\PagePositionMap\printRecordMap(), and TYPO3\CMS\Filelist\FileList\start().

◆ init()

TYPO3\CMS\Core\Localization\LanguageService::init (   $languageKey)

Initializes the backend language. This is for example done in \TYPO3\CMS\Backend\Template\DocumentTemplate with lines like these: $LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class); $LANG->init($GLOBALS['BE_USER']->uc['lang']);

Exceptions

Definition at line 84 of file LanguageService.php.

References $locales.

Referenced by TYPO3\CMS\Backend\Controller\LoginController\__construct().

◆ loadSingleTableDescription()

TYPO3\CMS\Core\Localization\LanguageService::loadSingleTableDescription (   $table)

Loading $TCA_DESCR[$table]['columns'] with content from locallang files as defined in $TCA_DESCR[$table]['refs'] $TCA_DESCR is a global var

Parameters
string$table‪Table name found as key in global array $TCA_DESCR

Definition at line 195 of file LanguageService.php.

References $GLOBALS, and TYPO3\CMS\Core\Localization\LanguageService\includeLLFile().

Referenced by TYPO3\CMS\Backend\Domain\Repository\TableManualRepository\getSingleManual(), TYPO3\CMS\Backend\Domain\Repository\TableManualRepository\getTableFieldNames(), and TYPO3\CMS\Backend\Domain\Repository\TableManualRepository\getTableManual().

◆ readLLfile()

array TYPO3\CMS\Core\Localization\LanguageService::readLLfile (   $fileRef)
protected

Includes a locallang file and returns the $LOCAL_LANG array found inside.

Parameters
string$fileRef‪Input is a file-reference to be a 'local_lang' file containing a $LOCAL_LANG array
Returns
‪array value of $LOCAL_LANG found in the included file, empty if non found

Definition at line 295 of file LanguageService.php.

References TYPO3\CMS\Core\Localization\LanguageService\$lang, and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

Referenced by TYPO3\CMS\Core\Localization\LanguageService\includeLLFile(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

◆ sL()

string TYPO3\CMS\Core\Localization\LanguageService::sL (   $input)

splitLabel function

All translations are based on $LOCAL_LANG variables. 'language-splitted' labels can therefore refer to a local-lang file + index. Refer to 'Inside TYPO3' for more details

Parameters
string$input‪Label key/reference
Returns
‪string

Definition at line 158 of file LanguageService.php.

References TYPO3\CMS\Core\Localization\LanguageService\$lang, $output, TYPO3\CMS\Core\Localization\LanguageService\debugLL(), TYPO3\CMS\Core\Localization\LanguageService\getLLL(), and TYPO3\CMS\Core\Localization\LanguageService\readLLfile().

Referenced by TYPO3\CMS\Backend\View\BackendLayoutView\addBackendLayoutItems(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\addData(), TYPO3\CMS\Core\Utility\File\ExtendedFileUtility\addMessageToFlashMessageQueue(), TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository\addShortcut(), TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler\canHandleLink(), TYPO3\CMS\Backend\Controller\OnlineMediaController\createAction(), TYPO3\CMS\Frontend\Hooks\FrontendHooks\displayPreviewInfoMessage(), TYPO3\CMS\Core\TypoScript\ExtendedTemplateService\ext_compareFlatSetups(), TYPO3\CMS\Core\TypoScript\ExtendedTemplateService\ext_printFields(), TYPO3\CMS\IndexedSearch\Controller\AdministrationController\generateMenu(), TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandAdditionalFieldProvider\getActionField(), TYPO3\CMS\Core\Site\Entity\NullSite\getAvailableLanguages(), TYPO3\CMS\Backend\Tree\View\FolderTreeView\getBrowseableTreeForStorage(), TYPO3\CMS\Core\Category\CategoryRegistry\getCategoryFieldsForTable(), TYPO3\CMS\Backend\View\BackendLayoutView\getColumnName(), TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider\getDefaultLanguageLabel(), TYPO3\CMS\Workspaces\Service\HistoryService\getDifferences(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getEncryptedConnectionStatus(), TYPO3\CMS\Linkvalidator\Linktype\LinkHandler\getErrorMessage(), TYPO3\CMS\Workspaces\Controller\Remote\ActionHandler\getErrorResponse(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getHtaccessUploadStatus(), TYPO3\CMS\Adminpanel\Modules\Info\RequestInformation\getLabel(), TYPO3\CMS\Adminpanel\Modules\Info\PhpInformation\getLabel(), TYPO3\CMS\Adminpanel\Modules\InfoModule\getLabel(), TYPO3\CMS\Adminpanel\Modules\TsDebugModule\getLabel(), TYPO3\CMS\Adminpanel\Modules\DebugModule\getLabel(), TYPO3\CMS\Adminpanel\Modules\Debug\QueryInformation\getLabel(), TYPO3\CMS\Adminpanel\Modules\TsDebug\TypoScriptWaterfall\getLabel(), TYPO3\CMS\Adminpanel\Modules\Debug\Log\getLabel(), TYPO3\CMS\Adminpanel\Modules\PreviewModule\getLabel(), TYPO3\CMS\Adminpanel\Modules\CacheModule\getLabel(), TYPO3\CMS\Adminpanel\Modules\Info\GeneralInformation\getLabel(), TYPO3\CMS\Adminpanel\Modules\EditModule\getLabel(), TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController\getLabelForTableColumn(), TYPO3\CMS\Backend\Form\Element\InputLinkElement\getLinkExplanation(), TYPO3\CMS\Workspaces\Middleware\WorkspacePreview\getLogoutTemplateMessage(), TYPO3\CMS\Workspaces\Controller\Remote\MassActionHandler\getMassStageActions(), TYPO3\CMS\Reports\Report\Status\ConfigurationStatus\getMemcachedConnectionStatus(), TYPO3\CMS\Core\FormProtection\FormProtectionFactory\getMessageClosure(), TYPO3\CMS\RteCKEditor\Controller\BrowseLinksController\getPageConfigLabel(), TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController\getPageTitle(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\getPreviewLanguages(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\getPreviewPresets(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\getRegisteredClasses(), TYPO3\CMS\Scheduler\Task\FileStorageExtractionAdditionalFieldProvider\getRegisteredExtractorsField(), TYPO3\CMS\Workspaces\Controller\Remote\RemoteServer\getRowDetails(), TYPO3\CMS\Rsaauth\Report\RsauthStatus\getRsaAuthStatus(), TYPO3\CMS\Backend\View\PageLayoutView\getTable_tt_content(), TYPO3\CMS\Backend\Domain\Repository\TableManualRepository\getTableFieldLabel(), TYPO3\CMS\Reports\Report\Status\SecurityStatus\getTrustedHostsPatternStatus(), TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController\getWizardGroupHeader(), TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController\getWizardItem(), TYPO3\CMS\Workspaces\Controller\ReviewController\indexAction(), TYPO3\CMS\Backend\Controller\File\RenameFileController\init(), TYPO3\CMS\Backend\Controller\File\FileUploadController\init(), TYPO3\CMS\Backend\Controller\File\CreateFolderController\init(), TYPO3\CMS\Backend\Controller\File\EditFileController\init(), TYPO3\CMS\Backend\Controller\NewRecordController\init(), TYPO3\CMS\Backend\Form\FormResultCompiler\JSbottom(), TYPO3\CMS\Scheduler\Controller\SchedulerModuleController\listTasksAction(), TYPO3\CMS\Core\DataHandling\DataHandler\localize(), TYPO3\CMS\Filelist\FileList\makeEdit(), TYPO3\CMS\Backend\Module\BaseScriptClass\mergeExternalItems(), TYPO3\CMS\Info\Controller\InfoModuleController\mergeExternalItems(), TYPO3\CMS\Taskcenter\Controller\TaskModuleController\mergeExternalItems(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mergeExternalItems(), TYPO3\CMS\Impexp\Controller\ImportExportController\mergeExternalItems(), TYPO3\CMS\Core\Database\QueryGenerator\mkTableSelect(), TYPO3\CMS\Workspaces\Hook\DataHandlerHook\notifyStageChange(), TYPO3\CMS\Backend\View\PageLayoutView\pages_drawItem(), TYPO3\CMS\Install\Service\ExtensionConfigurationService\parseComments(), TYPO3\CMS\Core\DataHandling\DataHandler\prependLabel(), TYPO3\CMS\Form\Hooks\FormPagePreviewRenderer\preProcess(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\registerDocHeader(), TYPO3\CMS\Backend\Form\FieldInformation\TcaDescription\render(), TYPO3\CMS\Backend\Form\Element\SelectCheckBoxElement\render(), TYPO3\CMS\Backend\Form\Element\InputSlugElement\render(), TYPO3\CMS\Backend\Form\Container\InlineRecordContainer\renderCombinationChild(), TYPO3\CMS\Backend\Controller\File\ReplaceFileController\renderContent(), TYPO3\CMS\Backend\Controller\PageLayoutController\renderContent(), TYPO3\CMS\Scheduler\Task\ExecuteSchedulableCommandAdditionalFieldProvider\renderOptionField(), TYPO3\CMS\Workspaces\Middleware\WorkspacePreview\renderPreviewInfo(), TYPO3\CMS\Fluid\ViewHelpers\Be\Labels\CshViewHelper\renderStatic(), TYPO3\CMS\RteCKEditor\Form\Element\RichTextElement\replaceLanguageFileReferences(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems\sanitizeConfiguration(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems\sanitizeLabeledToggleCheckbox(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\showAction(), TYPO3\CMS\Reports\Report\Status\Status\sortStatusProviders(), TYPO3\CMS\IndexedSearch\Controller\AdministrationController\statisticDetailsAction(), TYPO3\CMS\Backend\View\PageLayoutView\tt_content_drawItem(), TYPO3\CMS\Extensionmanager\Controller\UpdateFromTerController\updateExtensionListFromTerAction(), and TYPO3\CMS\Workspaces\Hook\DataHandlerHook\version_swap().

Member Data Documentation

◆ $debugKey

bool TYPO3\CMS\Core\Localization\LanguageService::$debugKey = false

If TRUE, will show the key/location of labels in the backend.

Definition at line 40 of file LanguageService.php.

◆ $lang

string TYPO3\CMS\Core\Localization\LanguageService::$lang = 'default'

This is set to the language that is currently running for the user

Definition at line 34 of file LanguageService.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageService\getLLL(), TYPO3\CMS\Core\Localization\LanguageService\readLLfile(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

◆ $languageDependencies

array TYPO3\CMS\Core\Localization\LanguageService::$languageDependencies = array( )
protected

List of language dependencies for actual language. This is used for local variants of a language that depend on their "main" language, like Brazilian Portuguese or Canadian French.

Definition at line 59 of file LanguageService.php.

◆ $languageFileCache

array TYPO3\CMS\Core\Localization\LanguageService::$languageFileCache = array( )
protected

An internal cache for storing loaded files, see readLLfile()

Definition at line 65 of file LanguageService.php.

◆ $LL_files_cache

array TYPO3\CMS\Core\Localization\LanguageService::$LL_files_cache = array( )

Internal cache for read LL-files

Definition at line 46 of file LanguageService.php.

◆ $LL_labels_cache

array TYPO3\CMS\Core\Localization\LanguageService::$LL_labels_cache = array( )

Internal cache for ll-labels (filled as labels are requested)

Definition at line 52 of file LanguageService.php.