function translation_helpers_get_translation in Translation helpers 7
Same name and namespace in other branches
- 6 translation_helpers.module \translation_helpers_get_translation()
Return the translation of a node in a given language.
File
- ./
translation_helpers.module, line 101 - 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;
}