How to get the path to the translated node? I've set up a multilanguage site in Drupal 7. In a template I need to add a link to a specific content node. This node has translations and path aliases like so:

node/42 = pathalias_de (german version)
node/43 = pathalias_en (english version)


In the template I'd like to call url() to get the link to the aliased version of the content node in the current language.

On the german page it should link to /de/pathalias_de on the english page to /en/pathalias_en

I've tried several variations, like calling the nid, calling the alias, passing the current language object to url().

Is this something url() should be able to do or do I need a different function? Thanks!
After looking at the source of the "Content translation" module I've come up with this solution:

    global $language;
    $translations = translation_path_get_translations("node/42");
    /*
    Returns the paths of all translations of a node, based on its Drupal path:
    array(2) {
        ["de"]=&gt;string(7) "node/42"
        ["en"]=&gt;string(7) "node/43"
    }
    */
    print l(t('Link Title'), $translations[$language-&gt;language]); //l() will return the alias to node/42


This will output the link to the correct node alias. Works and isn't overly complicated - still wonder if there's a function that already does this.