Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
LocalizationUtility (Extbase)
This class is used to translate strings within Extbase context. For an example see Localization in Extbase.
- class LocalizationUtility
-
- Fully qualified name
-
\TYPO3\
CMS\ Extbase\ Utility\ Localization Utility
Localization helper which should be used to fetch localized labels.
- translate ( string $key, string $extensionName = NULL, array $arguments = NULL, string $languageKey = NULL, array $alternativeLanguageKeys = NULL)
-
Returns the localized label of the LOCAL_LANG key, $key.
- param string $key
-
The key from the LOCAL_LANG array for which to return the value.
- param string $extensionName
-
The name of the extension, default: NULL
- param array $arguments
-
The arguments of the extension, being passed over to sprintf, default: NULL
- param string $languageKey
-
The language key or null for using the current language from the system, default: NULL
- param array $alternativeLanguageKeys
-
The alternative language keys if no translation was found., default: NULL
- returntype
-
string
- Returns
-
The value from LOCAL_LANG or null if no translation was found.