You are here

function webform_translation_node_view in Webform Translation 7

Implements hook_node_view().

File

./webform_translation.module, line 319

Code

function webform_translation_node_view($node) {
  global $language_content;

  // Translate webform components.
  if (in_array($node->type, webform_variable_get('webform_node_types'))) {
    if (isset($node->webform)) {
      $component = array(
        'nid' => $node->nid,
        'cid' => WEBFORM_TRANSLATION_CONFIGURATION_COMPONENT,
        'submit_text' => $node->webform['submit_text'],
      );
      $node->webform['submit_text'] = webform_translation_component_get_translation($component, 'submit_text', $language_content->language);
    }
  }
}