ManualLocalizationHandler implements LocalizationHandlerInterface
Manual localization handler
Handles manual localization through the wizard interface, supporting both copy and translate operations based on the selected mode
Table of Contents
Interfaces
- LocalizationHandlerInterface
- Interface for localization handlers that perform the actual localization logic
Properties
Methods
- __construct() : mixed
- getDescription() : string
- Get a description of what this handler does
- getIconIdentifier() : string
- Get the icon identifier for this handler
- getIdentifier() : string
- Get a unique identifier for this handler
- getLabel() : string
- Get a human-readable label for this handler
- isAvailable() : bool
- Check if this handler is available for the given localization context
- processLocalization() : LocalizationResult
- Process the localization for the given records
- generateRedirectUrl() : string|null
- Generate redirect URL based on record type
- getLanguageService() : LanguageService
- processPageLocalization() : LocalizationResult
- Process page localization including selected content elements
- processSingleRecordLocalization() : LocalizationResult
- Process single record localization (non-page records)
Properties
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(UriBuilder $uriBuilder) : mixed
Parameters
- $uriBuilder : UriBuilder
getDescription()
Get a description of what this handler does
public
getDescription() : string
Return values
string —Description shown to help users choose the right handler (can be a translation key LLL:...)
getIconIdentifier()
Get the icon identifier for this handler
public
getIconIdentifier() : string
Return values
string —Icon identifier that can be resolved by the IconFactory
getIdentifier()
Get a unique identifier for this handler
public
getIdentifier() : string
Return values
string —Unique identifier (e.g., 'manual', 'deepl', 'google_translate')
getLabel()
Get a human-readable label for this handler
public
getLabel() : string
Return values
string —Label that will be displayed in the UI (can be a translation key LLL:...)
isAvailable()
Check if this handler is available for the given localization context
public
isAvailable(LocalizationInstructions $instructions) : bool
This is a pre-flight check before showing the handler to the user. It receives the same context as processLocalization() to determine if the handler can process this specific localization request.
Handlers can use this to determine if they support:
- Specific record types (e.g., only pages or tt_content)
- Specific source/target language combinations
- Specific localization modes (copy vs translate)
- Other contextual requirements (e.g., API keys configured, specific records)
Parameters
- $instructions : LocalizationInstructions
Return values
bool —True if this handler can process the localization in this context
processLocalization()
Process the localization for the given records
public
processLocalization(LocalizationInstructions $instructions) : LocalizationResult
Parameters
- $instructions : LocalizationInstructions
Return values
LocalizationResult —The result of the localization operation
generateRedirectUrl()
Generate redirect URL based on record type
protected
generateRedirectUrl(string $type, int $uid, int $targetLanguage) : string|null
Parameters
- $type : string
- $uid : int
- $targetLanguage : int
Return values
string|nullgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServiceprocessPageLocalization()
Process page localization including selected content elements
protected
processPageLocalization(LocalizationMode $mode, int $pageUid, int $targetLanguage, array<string|int, mixed> $additionalData) : LocalizationResult
Parameters
- $mode : LocalizationMode
- $pageUid : int
- $targetLanguage : int
- $additionalData : array<string|int, mixed>
Return values
LocalizationResultprocessSingleRecordLocalization()
Process single record localization (non-page records)
protected
processSingleRecordLocalization(LocalizationMode $mode, string $type, int $uid, int $targetLanguage) : LocalizationResult
Parameters
- $mode : LocalizationMode
- $type : string
- $uid : int
- $targetLanguage : int