<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Drupal &#8211; create links to translated nodes</title>
	<atom:link href="http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes</link>
	<description>Web Design &#38; Development, SEO and Project Management</description>
	<lastBuildDate>Thu, 15 Dec 2011 08:22:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Joanne</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-23145</link>
		<dc:creator>Joanne</dc:creator>
		<pubDate>Mon, 09 May 2011 11:05:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-23145</guid>
		<description>I am an user of Wordpress and I am just wondering whether there is a code which can be added, which will enable visitors to a site to easily translate the article on screen?</description>
		<content:encoded><![CDATA[<p>I am an user of WordPress and I am just wondering whether there is a code which can be added, which will enable visitors to a site to easily translate the article on screen?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-20050</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 07 Mar 2011 03:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-20050</guid>
		<description>Thanks, Gabriel! Just what I needed, my code to print out a translated node:
&lt;code&gt;
&lt;?php
$nid = 66;

$translations = translation_node_get_translations($nid);
if (!empty($translations)) {
  global $language;
  if (!empty($translations[$language-&gt;language])) {
    $nid = $translations[$language-&gt;language]-&gt;nid;
  }
}
$node = node_load($nid);
$build = node_view($node);
print drupal_render($build);
?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks, Gabriel! Just what I needed, my code to print out a translated node:<br />
<code><br />
&lt;?php<br />
$nid = 66;</p>
<p>$translations = translation_node_get_translations($nid);<br />
if (!empty($translations)) {<br />
  global $language;<br />
  if (!empty($translations[$language-&gt;language])) {<br />
    $nid = $translations[$language-&gt;language]-&gt;nid;<br />
  }<br />
}<br />
$node = node_load($nid);<br />
$build = node_view($node);<br />
print drupal_render($build);<br />
?&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PA Amplifier :</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-13917</link>
		<dc:creator>PA Amplifier :</dc:creator>
		<pubDate>Thu, 28 Oct 2010 11:52:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-13917</guid>
		<description>is there a good free french translation tool on the internet ?.``</description>
		<content:encoded><![CDATA[<p>is there a good free french translation tool on the internet ?.&#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Athena Adam</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-12880</link>
		<dc:creator>Athena Adam</dc:creator>
		<pubDate>Tue, 21 Sep 2010 15:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-12880</guid>
		<description>Hello, That was really very interesting and informative. For long I had been searching for a way out to provide such SEO friendly dynamic links for translated pages. Thanks a lot for some nice tips and codes. I wonder whether the same idea can be applied in case of google translated pages like when we use Google translate module ( http://drupal.org/project/gtrans ) we get the translated page but the page URL remains the same instead of showing the language link like example.com/fr or it etc. Can your code be applied in such cases. Please help.</description>
		<content:encoded><![CDATA[<p>Hello, That was really very interesting and informative. For long I had been searching for a way out to provide such SEO friendly dynamic links for translated pages. Thanks a lot for some nice tips and codes. I wonder whether the same idea can be applied in case of google translated pages like when we use Google translate module ( <a href="http://drupal.org/project/gtrans" rel="nofollow">http://drupal.org/project/gtrans</a> ) we get the translated page but the page URL remains the same instead of showing the language link like example.com/fr or it etc. Can your code be applied in such cases. Please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Ungureanu</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-12709</link>
		<dc:creator>Gabriel Ungureanu</dc:creator>
		<pubDate>Fri, 17 Sep 2010 06:59:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-12709</guid>
		<description>But on the other hand, if we are to use the API function, wich would be the normal Drupal way, your function would look like this:

&lt;code&gt;
function _translation_nodelink($nid) {
  $translations = translation_node_get_translations($nid);
  if (!empty($translations)) {
    global $language;
    if (!empty($translations[$language-&gt;language])) {
      return l($translations[$language-&gt;language]-&gt;title,&#039;node/&#039;.$translations[$language-&gt;language]-&gt;nid);
    }
  }
  $node = node_load($nid);
  return l($node-&gt;title,&#039;node/&#039;.$node-&gt;nid);
}
&lt;/code&gt;

Then:
&lt;code&gt;
&lt;?php echo _translation_nodelink(1);?&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>But on the other hand, if we are to use the API function, wich would be the normal Drupal way, your function would look like this:</p>
<p><code><br />
function _translation_nodelink($nid) {<br />
  $translations = translation_node_get_translations($nid);<br />
  if (!empty($translations)) {<br />
    global $language;<br />
    if (!empty($translations[$language-&gt;language])) {<br />
      return l($translations[$language-&gt;language]-&gt;title,&#039;node/&#039;.$translations[$language-&gt;language]-&gt;nid);<br />
    }<br />
  }<br />
  $node = node_load($nid);<br />
  return l($node-&gt;title,&#039;node/&#039;.$node-&gt;nid);<br />
}<br />
</code></p>
<p>Then:<br />
<code><br />
&lt;?php echo _translation_nodelink(1);?&gt;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Ungureanu</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-12708</link>
		<dc:creator>Gabriel Ungureanu</dc:creator>
		<pubDate>Fri, 17 Sep 2010 06:51:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-12708</guid>
		<description>I have updated the query from:
   $result = db_query(&quot;SELECT n2.nid, n2.title FROM {node} n1, {node} n2 WHERE n1.tnid = n2.tnid and n1.nid = %d and n2.language = &#039;%s&#039;&quot;, $nid, $language-&gt;language);

to:

   $result = db_query(&quot;SELECT n2.nid, n2.title FROM {node} n1, {node} n2 WHERE n1.tnid = n2.tnid and n1.nid != 0 and n1.nid = %d and n2.language = &#039;%s&#039;&quot;, $nid, $language-&gt;language);

To provide accurate results if the node has no translations.</description>
		<content:encoded><![CDATA[<p>I have updated the query from:<br />
   $result = db_query(&#8220;SELECT n2.nid, n2.title FROM {node} n1, {node} n2 WHERE n1.tnid = n2.tnid and n1.nid = %d and n2.language = &#8216;%s&#8217;&#8221;, $nid, $language-&gt;language);</p>
<p>to:</p>
<p>   $result = db_query(&#8220;SELECT n2.nid, n2.title FROM {node} n1, {node} n2 WHERE n1.tnid = n2.tnid and n1.nid != 0 and n1.nid = %d and n2.language = &#8216;%s&#8217;&#8221;, $nid, $language-&gt;language);</p>
<p>To provide accurate results if the node has no translations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sohail arif</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-10797</link>
		<dc:creator>sohail arif</dc:creator>
		<pubDate>Fri, 11 Jun 2010 11:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-10797</guid>
		<description>great article. I got exactly the thing what i was looking for</description>
		<content:encoded><![CDATA[<p>great article. I got exactly the thing what i was looking for</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fletch</title>
		<link>http://www.webopius.com/content/328/drupal-create-links-to-translated-nodes/comment-page-1#comment-9823</link>
		<dc:creator>Fletch</dc:creator>
		<pubDate>Thu, 22 Apr 2010 15:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.webopius.com/content/?p=328#comment-9823</guid>
		<description>What about the core translation_node_get_translations function?

http://api.drupal.org/api/function/translation_node_get_translations/6</description>
		<content:encoded><![CDATA[<p>What about the core translation_node_get_translations function?</p>
<p><a href="http://api.drupal.org/api/function/translation_node_get_translations/6" rel="nofollow">http://api.drupal.org/api/function/translation_node_get_translations/6</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.425 seconds -->

