PageLanguageInformationService

final readonly class \TYPO3\CMS\Backend\Service\PageLanguageInformationService

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.
getOrphanedLanguageIds()  : int[]
Get the languages of records on the page which cannot be selected in the language menu, because the page has no translation into them or the site does not configure them. Languages the user has no access to are left out. The root level has no page translations and is therefore not checked.
getOrphanedLanguageMessage()  : string
Describe orphaned languages for editors: the titles of site languages the page has not been translated into, and a general note for languages the site does not configure, whose IDs carry no meaning for editors.

Methods

getOrphanedLanguageIds()

Get the languages of records on the page which cannot be selected in the language menu, because the page has no translation into them or the site does not configure them. Languages the user has no access to are left out. The root level has no page translations and is therefore not checked.

public getOrphanedLanguageIds(PageLanguageInformation $languageInformation, BackendUserAuthentication $backendUser) : int[]

Not part of getLanguageInformationForPage(), since it queries every language-aware table and only the modules listing these records need it.

Parameters

$languageInformation : PageLanguageInformation
$backendUser : BackendUserAuthentication

Return values

int[] —

Sorted language IDs

getOrphanedLanguageMessage()

Describe orphaned languages for editors: the titles of site languages the page has not been translated into, and a general note for languages the site does not configure, whose IDs carry no meaning for editors.

public getOrphanedLanguageMessage(PageLanguageInformation $languageInformation, int[] $orphanedLanguageIds, LanguageService $languageService) : string

Parameters

$languageInformation : PageLanguageInformation
$orphanedLanguageIds : int[]
$languageService : LanguageService

Return values

string
On this page