diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-16 21:36:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-16 21:36:57 +0000 |
commit | 553d8885bd59e3aa310fa3a81afff062d94db100 (patch) | |
tree | f99838fdb52aa01cfff2013f6eaef74862ba2f59 /modules/translation/translation.module | |
parent | 78fd1a143a3e999671fbd2ce6e4bba80816081b9 (diff) | |
download | brdo-553d8885bd59e3aa310fa3a81afff062d94db100.tar.gz brdo-553d8885bd59e3aa310fa3a81afff062d94db100.tar.bz2 |
- Patch #287949 by Freso, Damien Tournoud: keep language icons in consistent order across nodes.
Diffstat (limited to 'modules/translation/translation.module')
-rw-r--r-- | modules/translation/translation.module | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/translation/translation.module b/modules/translation/translation.module index d46900eb7..79d746e6d 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -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; |