- Patch #287949 by Freso, Damien Tournoud: keep language icons in consistent order across nodes.

merge-requests/26/head
Dries Buytaert 2008-08-16 21:36:57 +00:00
parent 78fd1a143a
commit 553d8885bd
1 changed files with 9 additions and 7 deletions

View File

@ -166,13 +166,15 @@ function translation_link($type, $node = NULL, $teaser = FALSE) {
// Do not show link to the same node. // Do not show link to the same node.
unset($translations[$node->language]); unset($translations[$node->language]);
$languages = language_list(); $languages = language_list();
foreach ($translations as $language => $translation) { foreach ($languages as $langcode => $language) {
$links["node_translation_$language"] = array( if (isset($translations[$langcode])) {
'title' => $languages[$language]->native, $links["node_translation_$langcode"] = array(
'href' => "node/$translation->nid", 'title' => $language->native,
'language' => $languages[$language], 'href' => 'node/' . $translations[$langcode]->nid,
'attributes' => array('title' => $translation->title, 'class' => 'translation-link') 'language' => $language,
); 'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link')
);
}
} }
} }
return $links; return $links;