function rules_i18n_rules_action_info in Rules 7.2
Implements hook_rules_action_info().
File
- rules_i18n/
rules_i18n.rules.inc, line 11 - Internationalization rules integration.
Code
function rules_i18n_rules_action_info() {
$items['rules_i18n_t'] = array(
'label' => t('Translate a text'),
'group' => t('Translation'),
'parameter' => array(
'text' => array(
'type' => 'text',
'label' => t('Text'),
'description' => t('The text to translate.'),
'translatable' => TRUE,
),
'language' => array(
'type' => 'token',
'label' => t('Language'),
'description' => t('The language to translate the text into.'),
'options list' => 'entity_metadata_language_list',
'default mode' => 'select',
),
),
'provides' => array(
'text' => array(
'type' => 'text',
'label' => t('The translated text'),
),
),
'base' => 'rules_i18n_action_t',
'access callback' => 'rules_i18n_rules_integration_access',
);
$items['rules_i18n_select'] = array(
'label' => t('Select a translated value'),
'group' => t('Translation'),
'parameter' => array(
'data' => array(
'type' => '*',
'label' => t('Data'),
'description' => t('Select a translated value, e.g. a translatable field. If the selected data is not translatable, the language neutral value will be selected.'),
'translatable' => TRUE,
'restrict' => 'select',
),
'language' => array(
'type' => 'token',
'label' => t('Language'),
'description' => t('The language to translate the value into.'),
'options list' => 'entity_metadata_language_list',
),
),
'provides' => array(
'data_translated' => array(
'type' => '*',
'label' => t('The translated value'),
),
),
'base' => 'rules_i18n_action_select',
'access callback' => 'rules_i18n_rules_integration_access',
);
return $items;
}