You are here

function tmgmt_test_tmgmt_source_suggestions in Translation Management Tool 7

Same name and namespace in other branches
  1. 8 tmgmt_test/tmgmt_test.module \tmgmt_test_tmgmt_source_suggestions()

Implements hook_tmgmt_source_suggestions().

File

tests/tmgmt_test.module, line 46
Module file of the translation management test module.

Code

function tmgmt_test_tmgmt_source_suggestions(array $items, TMGMTJob $job) {
  $suggestions = array();
  foreach ($items as $item) {
    if ($item->plugin == 'test_source') {
      $suggestions[] = array(
        'job_item' => tmgmt_job_item_create('test_source', $item->item_type . '_suggestion', $item->item_id),
        'reason' => t('Test suggestion for @type source @id', array(
          '@type' => $item->item_type,
          '@id' => $item->item_id,
        )),
        'from_item' => $item->tjiid,
      );
    }
  }
  return $suggestions;
}