Commit 553d8885 authored by Dries's avatar Dries

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

parent 78fd1a14
......@@ -166,13 +166,15 @@ function translation_link($type, $node = NULL, $teaser = FALSE) {
// Do not show link to the same node.
unset($translations[$node->language]);
$languages = language_list();
foreach ($translations as $language => $translation) {
$links["node_translation_$language"] = array(
'title' => $languages[$language]->native,
'href' => "node/$translation->nid",
'language' => $languages[$language],
'attributes' => array('title' => $translation->title, 'class' => 'translation-link')
);
foreach ($languages as $langcode => $language) {
if (isset($translations[$langcode])) {
$links["node_translation_$langcode"] = array(
'title' => $language->native,
'href' => 'node/' . $translations[$langcode]->nid,
'language' => $language,
'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link')
);
}
}
}
return $links;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment