LanguageSelectorBuilder

final readonly class \TYPO3\CMS\Backend\Template\Components\Buttons\LanguageSelectorBuilder

Builds the language selector dropdown for backend modules (Layout, Records, Recycler, record history).

This centralizes the language selection UI logic to ensure consistent behavior across all modules. It handles both single-select (radio buttons) and multi-select (toggles/checkboxes) modes.

Table of Contents

Methods

__construct()  : mixed
build()  : ButtonInterface
buildForSiteLanguages()  : ButtonInterface
Builds a single-select language selector for the given site languages, independent of the translations existing on a page, optionally with an entry for all languages.

Methods

buildForSiteLanguages()

Builds a single-select language selector for the given site languages, independent of the translations existing on a page, optionally with an entry for all languages.

public buildForSiteLanguages(SiteLanguage[] $siteLanguages, int|null $selectedLanguageId, callable(int|null): string $urlBuilder[, bool $showAllLanguages = true ]) : ButtonInterface

Used by modules filtering or switching records by language.

Parameters

$siteLanguages : SiteLanguage[]
$selectedLanguageId : int|null

Null for all languages

$urlBuilder : callable(int|null): string
$showAllLanguages : bool = true

Return values

ButtonInterface
On this page