Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.22 diff -u -r1.22 translation.module --- modules/translation/translation.module 9 Jan 2008 11:51:54 -0000 1.22 +++ modules/translation/translation.module 12 Jan 2008 07:05:21 -0000 @@ -226,6 +226,13 @@ if (!empty($node->translation['retranslate'])) { // This is the source node, asking to mark all translations outdated. db_query("UPDATE {node} SET translate = 1 WHERE tnid = %d AND nid != %d", $node->tnid, $node->nid); + + // Let every module know the nodes that require a retranslation. + $result = db_query('SELECT nid FROM {node} WHERE tnid = %d AND nid != %d', $node->tnid, $node->nid); + while ($translation = db_fetch_object($result)) { + $translation = node_load($translation->nid); + node_invoke_nodeapi($translation, 'retranslate'); + } } } break; @@ -338,3 +345,29 @@ } } +/** + * Implementation of hook_hook_info(). + */ +function translation_hook_info() { + return array( + 'node' => array( + 'nodeapi' => array( + 'retranslate' => array( + 'runs when' => t('After flagging the translations of a source node as outdated'), + ), + ) + ) + ); +} + +/** + * Implementation of hook_action_info_alter(). + */ +function translation_action_info_alter(&$actions) { + foreach ($actions as $key => $action) { + if (isset($action['hooks']['nodeapi']) && !in_array('retranslate', $action['hooks']['nodeapi'])) { + $actions[$key]['hooks']['nodeapi'][] = 'retranslate'; + } + } +} + Index: modules/trigger/trigger.module =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v retrieving revision 1.12 diff -u -r1.12 trigger.module --- modules/trigger/trigger.module 31 Dec 2007 14:51:04 -0000 1.12 +++ modules/trigger/trigger.module 12 Jan 2008 07:05:23 -0000 @@ -212,7 +212,7 @@ // Prevent recursion by tracking which operations have already been called. static $recursion; // Support a subset of operations. - if (!in_array($op, array('view', 'update', 'presave', 'insert', 'delete')) || isset($recursion[$op])) { + if (!in_array($op, array('view', 'update', 'presave', 'insert', 'delete', 'retranslate')) || isset($recursion[$op])) { return; } $recursion[$op] = TRUE;