How to delete all translations when deleting a node using default language? I'm trying to delete all translations when deleting a node using default language?

For that purpose, I am using the hook_node_delete, but I am not able to invoke node_delete() from it. It cause a fatal error and the process can't terminate. Even the first node I am deleting isn't deleted preoperly.

 function hook_node_delete($node){
        $translation_list = translation_node_get_translations($node-&gt;tnid);
        $default_language = language_default()-&gt;language;

        if($translation_list!=""){
           foreach($translation_list as $translation_list_item){    
              if ($translation_list_item-&gt;language!=$default_language){
                  node_delete($translation_list_item-&gt;nid);
              }
           };
        };
    }


So I am forced to simply unpublish the translations by doing something like that:

 function hook_node_delete($node){
                $translation_list = translation_node_get_translations($node-&gt;tnid);
                $default_language = language_default()-&gt;language;

                if($translation_list!=""){
                   foreach($translation_list as $translation_list_item){    
                      if ($translation_list_item-&gt;language!=$default_language){
                          $node_translated = node_load($translation_list_item-&gt;nid);
                          $node_translated-&gt;status = 0;
                          node_save($node_translated);
                      }
                   };
                };
            }


Why can I not invoke node_delete() from hook_node_delete()??
you first have to remove the nodes from the translation set before you can delete them. So do something like this:

function hook_node_delete($node){
    $all = translation_node_get_translations($node-&gt;tnid);

    foreach($all as $del){
        if($node-&gt;nid != $del-&gt;nid){
            translation_remove_from_set(node_load($del-&gt;nid));
            node_delete($del-&gt;nid);
        }
    }
}