Language 

The language frontend request attribute provides information about the current language of the webpage via the \TYPO3\CMS\Core\Site\Entity\SiteLanguage object.

Example:

$language = $request->getAttribute('language');
$locale = $language->getLocale();
Copied!

API 

class SiteLanguage
Fully qualified name
\TYPO3\CMS\Core\Site\Entity\SiteLanguage

Entity representing a site_language configuration of a site object.

toArray()

Returns the SiteLanguage in an array representation for e.g. the usage in TypoScript.

returntype

array

getLanguageId()
returntype

int

getLocale()
returntype

string

getBase()
returntype

Psr\Http\Message\UriInterface

getTitle()
returntype

string

getNavigationTitle()
returntype

string

getWebsiteTitle()
returntype

string

getFlagIdentifier()
returntype

string

getTypo3Language()
returntype

string

getTwoLetterIsoCode()

Returns the ISO-639-1 language ISO code

returntype

string

getHreflang()

Returns the RFC 1766 / 3066 language tag

returntype

string

getDirection()

Returns the language direction

returntype

string

enabled()

Returns true if the language is available in frontend usage

returntype

bool

isEnabled()

Helper so fluid can work with this as well.

returntype

bool

getFallbackType()
returntype

string

getFallbackLanguageIds()
returntype

array