I am trying to add the English title as a drupal_set_message on all node pages if available – (Ive done something similar on the CMS) and if the user has node edit permissions (this can be checked using the node_access function).
Code for cms example mentioned. Inside a hook form alter.
// Translation display on CMS page $nid = (isset($form['nid']['#value'])) ? $form['nid']['#value'] : false; if($nid) { $node = node_load($nid); if($node) { $lang = 'en'; $translations = translation_node_get_translations($node->tnid); $translated_node = (isset($translations[$lang])) ? node_load($translations[$lang]->nid) : $node; $translated_title = '<h3>English Translation: ' . $translated_node->title . '</h3>'; } } $form['#prefix'] = (isset($translated_title) && $translated_node->title != $node->title) ? $translated_title : '';
I am now wanting something similar but as a drupal_set_message on all node pages.