--- modules/translation/translation.module 5 Jul 2009 18:00:11 -0000 1.51 +++ modules/translation/translation.module 14 Jul 2009 20:53:16 -0000 @@ -397,9 +397,18 @@ function translation_path_get_translations($path) { $paths = array(); // Check for a node related path, and for its translations. - if ((preg_match("!^node/([0-9]+)(/.+|)$!", $path, $matches)) && ($node = node_load((int)$matches[1])) && !empty($node->tnid)) { - foreach (translation_node_get_translations($node->tnid) as $language => $translation_node) { - $paths[$language] = 'node/' . $translation_node->nid . $matches[2]; + if ((preg_match("!^node/([0-9]+)(/.+|)$!", $path, $matches)) && ($node = node_load((int)$matches[1]))) { + $translations = translation_node_get_translations($node->tnid); + if (!empty($translations)) { + foreach ($translations as $language => $translation_node) { + $paths[$language] = 'node/'. $translation_node->nid . $matches[2]; + } + } + else { + if ($node->language) { + // If node has no other translation than it is, return it. + $paths[$node->language] = 'node/'. $node->nid; + } } } return $paths;