You are here

function i18n_sync_node_get_translations in Internationalization 7

Get node translations if any, excluding the node itself

Parameters

$reset: Whether to reset the translation_node_get_translations cache.

1 call to i18n_sync_node_get_translations()
i18n_sync_node_update in i18n_sync/i18n_sync.module
Implements hook_node_update().

File

i18n_sync/i18n_sync.module, line 156
Internationalization (i18n) package. Synchronization of translations

Code

function i18n_sync_node_get_translations($node, $reset = FALSE) {
  if (!empty($node->tnid)) {
    if ($reset) {

      // Clear the static cache of translation_node_get_translations
      $translations_cache =& drupal_static('translation_node_get_translations', array());
      unset($translations_cache[$node->tnid]);
    }

    // Maybe translations are already here
    if ($translations = translation_node_get_translations($node->tnid)) {
      unset($translations[$node->language]);
      return $translations;
    }
  }
}