You are here

function hook_tmgmt_source_suggestions in Translation Management Tool 7

Same name and namespace in other branches
  1. 8 tmgmt.api.php \hook_tmgmt_source_suggestions()

Return a list of suggested sources for job items.

Parameters

array $items: An array with TMGMTJobItem objects which must be checked for suggested translations.

TMGMTJob $job: The current translation job to check for additional translation items.

Return value

array An array with all additional translation suggestions.

  • job_item: A TMGMTJobItem instance.
  • referenced: A string which indicates where this suggestion comes from.
  • from_job: The main TMGMTJob-ID which suggests this translation.

Related topics

3 functions implement hook_tmgmt_source_suggestions()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

tmgmt_entity_tmgmt_source_suggestions in sources/entity/tmgmt_entity.module
Implements hook_tmgmt_source_suggestions()
tmgmt_i18n_string_tmgmt_source_suggestions in sources/i18n_string/tmgmt_i18n_string.module
Implements hook_tmgmt_source_suggestions()
tmgmt_test_tmgmt_source_suggestions in tests/tmgmt_test.module
Implements hook_tmgmt_source_suggestions().
1 invocation of hook_tmgmt_source_suggestions()
TMGMTJob::getSuggestions in entity/tmgmt.entity.job.inc
Invoke the hook 'hook_tmgmt_source_suggestions' to get all suggestions.

File

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

Code

function hook_tmgmt_source_suggestions(array $items, TMGMTJob $job) {
  return array(
    array(
      'job_item' => tmgmt_job_item_create('entity', 'node', 0),
      'reason' => t('Referenced @type of field @label', array(
        '@type' => 'entity',
        '@label' => 'label',
      )),
      'from_item' => $items[1]->tjiid,
    ),
  );
}