Translation 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.

Functions & methods

NameLocationDescription
hook_tmgmt_entity_type_list_query_altersources/entity/tmgmt_entity.api.phpAllows to alter $query used to list entities on specific entity type overview pages.
hook_tmgmt_source_plugin_info./tmgmt.api.phpProvide information about source plugins.
hook_tmgmt_source_plugin_info_alter./tmgmt.api.phpAlter source plugins information.
hook_tmgmt_source_translation_structuresources/field/tmgmt_field.api.phpExtract translatable text elements from a field.
tmgmt_source_is_translatable_item_type./tmgmt.module
tmgmt_source_plugin_controller./tmgmt.moduleGet the plugin controller class for a given source plugin.
tmgmt_source_plugin_info./tmgmt.moduleDetermines all available source object plugins.
tmgmt_source_plugin_labels./tmgmt.moduleReturns 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./tmgmt.moduleReturns an array of translatable item types of a source plugin.
tmgmt_source_ui_controller./tmgmt.moduleGet the ui controller class for a given source plugin.
tmgmt_source_views_controller./tmgmt.moduleGet the views controller class for a given source plugin.

Classes

NameLocationDescription
TMGMTDefaultSourcePluginControllerplugin/tmgmt.plugin.source.incDefault controller class for source plugins.
TMGMTDefaultSourceUIControllerplugin/tmgmt.ui.source.incDefault ui controller class for source plugin.
TMGMTEntityDefaultSourceUIControllersources/entity/tmgmt_entity.ui.incAbstract 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.
TMGMTEntitySourceUIControllersources/entity/ui/tmgmt_entity_ui.ui.incGeneric entity ui controller class for source plugin.

Interfaces

NameLocationDescription
TMGMTSourcePluginControllerInterfaceplugin/tmgmt.plugin.interface.source.incInterface for source plugin controllers.
TMGMTSourceUIControllerInterfaceplugin/tmgmt.ui.interface.source.incInterface for source ui controllers.

File

./tmgmt.api.php, line 155
Hooks provided by the Translation Management module.