title: In Drupal how to get tnid or the node id of the translated node?
body: <p>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.</p>
  
  <pre><code>  global $language;
    $translations = translation_node_get_translations($node-&gt;tnid);
    if ($translations[$language-&gt;language]) {
    $tnode = node_load($translations[$language-&gt;language]-&gt;nid);
    echo $tnode-&gt;nid;
    }
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>I need tnid to create a custom translation-link.  Thanks.</p>