I need to access the id of the translated node, if available for any given node. nid is the node id. It would seem tnid would be the id of the translated node. However, that seem not be the case. How can I get that id? I tried to the following code, which did not work.
global $language;
$translations = translation_node_get_translations($node->tnid);
if ($translations[$language->language]) {
$tnode = node_load($translations[$language->language]->nid);
echo $tnode->nid;
}
Any suggestions?
I need tnid to create a custom translation-link. Thanks.