TranslationConfigurationProvider
readonly class \
Contains translation tools
Internal
The whole class is subject to be removed, fetch all language info from the current site object.
Tags
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Methods
- __construct() : mixed
- getSystemLanguages() : array
- Returns array of languages given for a specific site (or "nullSite" if on page=0) The property flagIcon returns a string <flags-xx>.
- translationInfo() : array|string
- Information about translation for an element Will overlay workspace version of record too!
- addSiteLanguagesToConsolidatedList() : array
- getBackendUserAuthentication() : BackendUserAuthentication
Methods
__construct()
public
__construct(FrontendInterface $runtimeCache, SiteFinder $siteFinder, ConnectionPool $connectionPool) : mixed
Parameters
- $runtimeCache : FrontendInterface
- $siteFinder : SiteFinder
- $connectionPool : ConnectionPool
getSystemLanguages()
Returns array of languages given for a specific site (or "nullSite" if on page=0) The property flagIcon returns a string <flags-xx>.
public
getSystemLanguages([int $pageId = 0 ]) : array
Parameters
- $pageId : int = 0
-
Page id (used to get TSconfig configuration setting flag and label for default language)
Return values
arraytranslationInfo()
Information about translation for an element Will overlay workspace version of record too!
public
translationInfo(string $table, int $uid[, int $languageUid = 0 ][, array|null $row = null ][, array|string $selFieldList = '' ]) : array|string
Parameters
- $table : string
-
Table name
- $uid : int
-
Record uid
- $languageUid : int = 0
-
Language uid. If 0, then all languages are selected.
- $row : array|null = null
-
The record to be translated
- $selFieldList : array|string = ''
-
Select fields for the query which fetches the translations of the current record
Return values
array|string —Array with information or error message as a string.
addSiteLanguagesToConsolidatedList()
protected
addSiteLanguagesToConsolidatedList(array $allSystemLanguages, array $languagesOfSpecificSite, SiteInterface $site, bool $includeSiteSuffix) : array
Parameters
- $allSystemLanguages : array
- $languagesOfSpecificSite : array
- $site : SiteInterface
- $includeSiteSuffix : bool
Return values
arraygetBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication