You are here

function translation_helpers_get_translation in Translation helpers 6

Same name and namespace in other branches
  1. 7 translation_helpers.module \translation_helpers_get_translation()

Return the translation of a node in a given language.

File

./translation_helpers.module, line 87
Provides methods for other modules to use with translated content.

Code

function translation_helpers_get_translation($node, $language) {
  if (isset($node->tnid) && translation_supported_type($node->type)) {
    $translations = translation_node_get_translations($node->tnid);
    if (isset($translations[$language])) {
      return node_load($translations[$language]->nid);
    }
  }
  return FALSE;
}