Translation source in Translation Management Tool 7
Same name and namespace in other branches
- 8 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 TMGMTSourcePluginControllerInterface::getData().
- Save the accepted translations returned by the translation plugin in their sources in their implementation of TMGMTSourcePluginControllerInterface::saveTranslation().
File
- ./
tmgmt.api.php, line 182 - Hooks provided by the Translation Management module.
Functions
Name | Location | Description |
---|---|---|
hook_tmgmt_entity_type_list_query_alter |
sources/ |
Allows to alter $query used to list entities on specific entity type overview pages. |
hook_tmgmt_source_plugin_info |
./ |
Provide information about source plugins. |
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_source_translation_structure |
sources/ |
Extract translatable text elements from a field. |
tmgmt_source_is_translatable_item_type |
./ |
|
tmgmt_source_plugin_controller |
./ |
Get the plugin controller class for a given source plugin. |
tmgmt_source_plugin_info |
./ |
Determines all available source object plugins. |
tmgmt_source_plugin_labels |
./ |
Returns an array of all available source plugins with the labels as values and the machine-readable name as the key. |
tmgmt_source_translatable_item_types |
./ |
Returns an array of translatable item types of a source plugin. |
tmgmt_source_ui_controller |
./ |
Get the ui controller class for a given source plugin. |
tmgmt_source_views_controller |
./ |
Get the views controller class for a given source plugin. |
Classes
Name | Location | Description |
---|---|---|
TMGMTDefaultSourcePluginController |
plugin/ |
Default controller class for source plugins. |
TMGMTDefaultSourceUIController |
plugin/ |
Default ui controller class for source plugin. |
TMGMTEntityDefaultSourceUIController |
sources/ |
Abstract entity ui controller class for source plugin that provides getEntity() method to retrieve list of entities of specific type. It also allows to implement alter hook to alter the entity query for a specific type. |
TMGMTEntitySourceUIController |
sources/ |
Generic entity ui controller class for source plugin. |
Interfaces
Name | Location | Description |
---|---|---|
TMGMTSourcePluginControllerInterface |
plugin/ |
Interface for source plugin controllers. |
TMGMTSourceUIControllerInterface |
plugin/ |
Interface for source ui controllers. |