LocalizationHandlerInterface
Interface for localization handlers that perform the actual localization logic
Handlers are responsible for executing the localization based on the selected mode
This API is not yet stable and may change before the LTS release
Table of Contents
Methods
- 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
Methods
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