PageLanguageInformationService
Read onlyYes
FinalYes
Central service for gathering page language information.
This service provides the SINGLE source of truth for:
- Which languages exist (have translations)
- Which languages can be created (permissions + missing)
- Which languages are unavailable (no permission)
- Translation records with workspace overlay
- UI properties (labels, flags, icons)
Note: Languages marked as "Unavailable" are included in the result for potential future use (e.g., showing "No Access" indicators), but controllers currently filter them out before displaying the UI.
Table of Contents
Methods
- __construct() : mixed
- getLanguageInformationForPage() : PageLanguageInformation
- Get complete language information for a page.
- getLanguageItems() : array<string|int, LanguageItem>
- Get language items ready for UI rendering. Includes all UI properties (labels, flags, etc.)
Methods
__construct()
public
__construct(TcaSchemaFactory $tcaSchemaFactory, ConnectionPool $connectionPool, FrontendInterface $runtimeCache) : mixed
Parameters
- $tcaSchemaFactory : TcaSchemaFactory
- $connectionPool : ConnectionPool
- $runtimeCache : FrontendInterface
getLanguageInformationForPage()
Get complete language information for a page.
public
getLanguageInformationForPage(int $pageId, SiteInterface $site, BackendUserAuthentication $backendUser) : PageLanguageInformation
This method fetches and analyzes all language-related data for a page, including existing translations, permissions, and available languages.
Parameters
- $pageId : int
- $site : SiteInterface
- $backendUser : BackendUserAuthentication
Return values
PageLanguageInformationgetLanguageItems()
Get language items ready for UI rendering. Includes all UI properties (labels, flags, etc.)
protected
getLanguageItems(array<string|int, mixed> $languageStatuses, array<string|int, mixed> $availableLanguages) : array<string|int, LanguageItem>
Parameters
- $languageStatuses : array<string|int, mixed>
- $availableLanguages : array<string|int, mixed>
Return values
array<string|int, LanguageItem> —Array of language items