You are here

Translation source in Translation Management Tool 8

Same name and namespace in other branches
  1. 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

Namesort descending Location Description
hook_field_info_alter sources/content/tmgmt_content.api.php 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/content/tmgmt_content.api.php Allows to alter $query used to list entities on specific entity type overview pages.
hook_tmgmt_source_plugin_info_alter ./tmgmt.api.php Alter source plugins information.
hook_tmgmt_source_suggestions ./tmgmt.api.php Return a list of suggested sources for job items.
hook_tmgmt_translatable_fields_alter sources/content/tmgmt_content.api.php Allows to exclude some fields from translation with TMGMT.

Classes

Namesort descending Location Description
ConfigSourcePluginUi sources/tmgmt_config/src/ConfigSourcePluginUi.php Config source plugin UI.
ContentEntitySourcePluginUi sources/content/src/ContentEntitySourcePluginUi.php Content entity source plugin UI.
SourcePluginBase src/SourcePluginBase.php Default controller class for source plugins.
SourcePluginUiBase src/SourcePluginUiBase.php Default ui controller class for source plugin.

Interfaces

Namesort descending Location Description
ContinuousSourceInterface src/ContinuousSourceInterface.php Interface for continuous sources.
SourcePluginInterface src/SourcePluginInterface.php Interface for source plugin controllers.
SourcePluginUiInterface src/SourcePluginUiInterface.php Interface for source ui controllers.