Yannick, thanks for building and improving this plugin! Wondering if you could add optional parameters to OutputBilingualLink: default url (in case no $otherlangurl), link title (e.g., name of language here), and doecho (true=echo, false=return the link). Something like:
function OutputBilingualLink($post_id, $linktext = "Translation", $beforelink = "<div class='BilingualLink'>", $afterlink = "</div>", $defaulturl = "#", $linktitle = "", $doecho = false)
{
$otherlangurl = get_post_meta($post_id, "bilingual-linker-other-lang-url", true);
if ($otherlangurl != '')
{
$langlink = $beforelink . '<a href="' . $otherlangurl . '" title="' . $linktitle . '">' . $linktext . '</a>' . $afterlink;
} else {
$langlink = $beforelink . '<a href="' . $defaulturl . '" title="' . $linktitle . '">' . $linktext . '</a>' . $afterlink;
}
if ($doecho) {
echo ($langlink);
} else {
return $langlink;
}
}