I want to be able to clone/replicate a node from one language to another on click of a button using a custom module. Basically we have a view which displays all nodes in the system and under the "operations" column, we have Edit, Delete, Clone.
On click of the Clone button, I want to replicate the node (keeping the same exact data values as is except for the language field) to other languages.
I have installed the node_clone and replicate modules to help me, but I am struggling to see how I can create a custom module that can call the hooks in those contrib modules in such a way that I can save the node in different languages automatically instead of click on the "Translate" tab and manually doing it one by one.
I have tried calling the clone_node_save
from the Node clone module from my custom module, but that does not work.
How can I extend a module hook in a custom module?