You are here

function webform_localization_translate_strings in Webform Localization 7

Same name and namespace in other branches
  1. 7.4 includes/webform_localization.i18n.inc \webform_localization_translate_strings()

Translate general webform properties.

Parameters

$node: A node object.

2 calls to webform_localization_translate_strings()
webform_localization_i18n_string_refresh in ./webform_localization.module
Update / create / delete translation source for components.
webform_localization_node_load in ./webform_localization.module
Implements hook_node_load().

File

includes/webform_localization.i18n.inc, line 288
Webform Localization i18n_string integration.

Code

function webform_localization_translate_strings(&$node, $update = FALSE) {
  $option = array(
    'update' => $update,
    'sanitize' => FALSE,
  );
  $name = webform_localization_i18n_string_name($node->webform['nid'], 'confirmation');
  $node->webform['confirmation'] = i18n_string($name, $node->webform['confirmation'], $option);
  $name = webform_localization_i18n_string_name($node->webform['nid'], 'submit_text');
  $node->webform['submit_text'] = i18n_string($name, $node->webform['submit_text'], $option);

  // Allow to translate the redirect url if it's not set to none or the
  // default confirmation page.
  if (!in_array($node->webform['redirect_url'], array(
    '<confirmation>',
    '<none>',
  ))) {
    $name = webform_localization_i18n_string_name($node->webform['nid'], 'redirect_url');
    $node->webform['redirect_url'] = i18n_string($name, $node->webform['redirect_url'], $option);
  }
}