SiteLanguage

Entity representing a site_language configuration of a site object.

Table of Contents

Properties

$base  : UriInterface
The Base URL for this language
$configuration  : array<string|int, mixed>
Additional parameters configured for this site language
$enabled  : bool
$fallbackLanguageIds  : array<string|int, mixed>
$fallbackType  : string
$flagIdentifier  : string
The flag key (like "gb" or "fr") used to be used in TYPO3's Backend.
$hreflang  : string
Language tag for this language defined by RFC 1766 / 3066 for "hreflang" attribute
$languageId  : int
The language id.
$locale  : Locale
Locale, like 'de-CH' or 'en-GB'
$navigationTitle  : string
Label to be used within language menus
$title  : string
Label to be used within TYPO3 to identify the language
$typo3Language  : string
Prefix for TYPO3's language files. If empty, this is fetched from $locale
$websiteTitle  : string
Localized title of the site to be used in title tag.

Methods

__construct()  : mixed
SiteLanguage constructor.
enabled()  : bool
Returns true if the language is available in frontend usage
getBase()  : UriInterface
getFallbackLanguageIds()  : array<string|int, mixed>
getFallbackType()  : string
getFlagIdentifier()  : string
getHreflang()  : string
Returns the RFC 1766 / 3066 language tag for hreflang tags
getLanguageId()  : int
getLocale()  : Locale
getNavigationTitle()  : string
getTitle()  : string
getTypo3Language()  : string
Returns the XLF label language key, returns "default" when it is "en".
getWebsiteTitle()  : string
hasCustomTypo3Language()  : bool
isEnabled()  : bool
Helper so fluid can work with this as well.
toArray()  : array<string|int, mixed>
Returns the SiteLanguage in an array representation for e.g. the usage in TypoScript.

Properties

$base

The Base URL for this language

protected UriInterface $base

$configuration

Additional parameters configured for this site language

protected array<string|int, mixed> $configuration = []

$fallbackLanguageIds

protected array<string|int, mixed> $fallbackLanguageIds = []

$fallbackType

protected string $fallbackType = 'strict'

$flagIdentifier

The flag key (like "gb" or "fr") used to be used in TYPO3's Backend.

protected string $flagIdentifier = ''

$hreflang

Language tag for this language defined by RFC 1766 / 3066 for "hreflang" attribute

protected string $hreflang = ''

$languageId

The language id.

protected int $languageId

$navigationTitle

Label to be used within language menus

protected string $navigationTitle = ''

$title

Label to be used within TYPO3 to identify the language

protected string $title = 'Default'

$typo3Language

Prefix for TYPO3's language files. If empty, this is fetched from $locale

protected string $typo3Language = ''

$websiteTitle

Localized title of the site to be used in title tag.

protected string $websiteTitle = ''

Methods

__construct()

SiteLanguage constructor.

public __construct(int $languageId, string $locale, UriInterface $base, array<string|int, mixed> $configuration) : mixed
Parameters
$languageId : int
$locale : string
$base : UriInterface
$configuration : array<string|int, mixed>

enabled()

Returns true if the language is available in frontend usage

public enabled() : bool
Return values
bool

getBase()

public getBase() : UriInterface
Return values
UriInterface

getFallbackLanguageIds()

public getFallbackLanguageIds() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFallbackType()

public getFallbackType() : string
Return values
string

getFlagIdentifier()

public getFlagIdentifier() : string
Return values
string

getHreflang()

Returns the RFC 1766 / 3066 language tag for hreflang tags

public getHreflang([bool $fetchCustomSetting = false ]) : string
Parameters
$fetchCustomSetting : bool = false
Return values
string

getLanguageId()

public getLanguageId() : int
Return values
int

getNavigationTitle()

public getNavigationTitle() : string
Return values
string

getTitle()

public getTitle() : string
Return values
string

getTypo3Language()

Returns the XLF label language key, returns "default" when it is "en".

public getTypo3Language() : string

"default" is currently still needed for TypoScript label overloading. For locales like "en-US", this method returns "en_US" which can then be used for XLF file prefixes properly.

Return values
string

getWebsiteTitle()

public getWebsiteTitle() : string
Return values
string

hasCustomTypo3Language()

public hasCustomTypo3Language() : bool
Internal
Return values
bool

isEnabled()

Helper so fluid can work with this as well.

public isEnabled() : bool
Return values
bool

toArray()

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

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results