You are here

function lingotek_rules_entity_download_all in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.5 lingotek.rules.inc \lingotek_rules_entity_download_all()
  2. 7.6 lingotek.rules.inc \lingotek_rules_entity_download_all()
1 string reference to 'lingotek_rules_entity_download_all'
lingotek_rules_action_info in ./lingotek.rules.inc
Implements hook_rules_action_info().

File

./lingotek.rules.inc, line 107
Lingotek Module + Rules Module Integration

Code

function lingotek_rules_entity_download_all($wrapper, $settings, $state) {
  $entity_type = $wrapper
    ->type();
  $id = $wrapper
    ->getIdentifier();
  $entity = $wrapper
    ->value();
  $source_lingotek_locale = Lingotek::convertDrupal2Lingotek($entity->language);
  $target_languages = Lingotek::getLanguagesWithoutSource($source_lingotek_locale);
  foreach ($target_languages as $lingotek_locale) {
    lingotek_entity_download($entity, $entity_type, $lingotek_locale);
  }
}