Automatic redirection to node translation form
in Project codes
This CodeLet will redirect you to the translation form of a node after you have created a node. Make sure you have selected a language and not "Language neutral" when saving the node.
<?php
//$Id$
/**
* @file
*
* Redirect to translation form of a node
*
* @author Bhavin Joshi <http://twitter.com/bhavinhjoshi>
*/
function autotranslate_node_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
drupal_goto("node/add/page", "translation=". $node->nid ."&language=gu");
break;
}
}
?> (3 votes)
- Login or register to post comments
- 3158 reads
-
Your feedback


Recent comments
- I have contributed a module
20 weeks 6 days ago - Improved Image menu
39 weeks 3 days ago - Great code!
41 weeks 1 day ago - Code Search is ready
50 weeks 4 days ago - I would love to see an
1 year 2 weeks ago - Thank you very much for your
1 year 3 weeks ago - Commented code
1 year 3 weeks ago - We are glad to know that the
1 year 3 weeks ago - Enhancements to codes
1 year 3 weeks ago - We have developed a module
1 year 4 weeks ago



Comments
This is working for me. I have created an admin interface to proiritize the redirection to next language and it works like a charm!
Thanks for this CodeLet.
[url=http://joshics.in]JoshicsIN[/url]
I would rather choose to redirect the user to his/her interface language after the node is created in a different language.
I believe I just have to use $user object and use the languge data of the user.
Btw. thanks for the CodeLet. It really works.
Regards.
You can even create an admin interface using which you can configure the options such that you will see the form one by one for each language. All you need to do is to queue that languages with your admin interface and retrive the quie upon node creation.
Regards.
[url=http://twitter.com/DrupalD][i]Drupa Developer - A Comprehensive Guild to Drupal Developersl[/i][/url]