function rules_i18n_action_t_form_alter

Implements hook_form_FORMID_alter() for the action_t form.

Implements the form_alter callback for the "Translate a text" action to set a default selector.

File

rules_i18n/rules_i18n.rules.inc, line 85

Code

function rules_i18n_action_t_form_alter(&$form, &$form_state, $options, $element) {
    if (isset($form['parameter']['language']['settings']['language:select']) && empty($element->settings['language:select'])) {
        $form['parameter']['language']['settings']['language:select']['#default_value'] = 'site:current-page:language';
    }
}