Translation source in Translation Management Tool 8
Same name and namespace in other branches
- 7 tmgmt.api.php \tmgmt_source
A source plugin represents translatable elements on a site.
For example nodes, but also plain strings, menu items, other entities and so on.
To define a source, hook_tmgmt_source_plugin_info() needs to be implemented and a controller class (specified in the info) created.
A source has three separate tasks.
- Allows to create a new translation job and assign job items to itself.
- Extract the translatable text into a nested array when requested to do in their implementation of SourcePluginControllerInterface::getData().
- Save the accepted translations returned by the translation plugin in their sources in their implementation of SourcePluginControllerInterface::saveTranslation().
File
- ./
tmgmt.api.php, line 139 - Hooks provided by the Translation Management module.
Functions
Name | Location | Description |
---|---|---|
hook_field_info_alter |
sources/ |
Any module can override the default field processor and register its own class for a given field type in hook_field_info_alter() using the tmgmt_field_processor key. |
hook_tmgmt_content_list_query_alter |
sources/ |
Allows to alter $query used to list entities on specific entity type overview pages. |
hook_tmgmt_source_plugin_info_alter |
./ |
Alter source plugins information. |
hook_tmgmt_source_suggestions |
./ |
Return a list of suggested sources for job items. |
hook_tmgmt_translatable_fields_alter |
sources/ |
Allows to exclude some fields from translation with TMGMT. |
Classes
Name | Location | Description |
---|---|---|
ConfigSourcePluginUi |
sources/ |
Config source plugin UI. |
ContentEntitySourcePluginUi |
sources/ |
Content entity source plugin UI. |
SourcePluginBase |
src/ |
Default controller class for source plugins. |
SourcePluginUiBase |
src/ |
Default ui controller class for source plugin. |
Interfaces
Name | Location | Description |
---|---|---|
ContinuousSourceInterface |
src/ |
Interface for continuous sources. |
SourcePluginInterface |
src/ |
Interface for source plugin controllers. |
SourcePluginUiInterface |
src/ |
Interface for source ui controllers. |