You are here

function module_globallink_translate_node_for_language in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.api.php \module_globallink_translate_node_for_language()
  2. 7.6 globallink.api.php \module_globallink_translate_node_for_language()

By implementing this hook, you can programmatically filter out if a particular node is translatable or not for a particular language. If the node is not translatable, this method should not return anything (not even false). This hook is called just before the content is being send for translation.

Parameters

object $source_node: The source node object.

string $drupal_target_locale: Drupal target language selected by user for which this node is being translated.

Return value

bool TRUE if the translation was successful.

File

./globallink.api.php, line 96
This file provides an example for the implementation of hooks that other modules can implement. Please read documentation for more details.

Code

function module_globallink_translate_node_for_language($source_node, $drupal_target_locale) {
  if ($source_node->type == 'article' && $drupal_target_locale == 'fr') {
    return TRUE;
  }
}