function i18nstrings_translate_edit_form_validate in Internationalization 6
Process string editing form validations.
If it is an allowed format, skip default validation, the text will be filtered later
1 string reference to 'i18nstrings_translate_edit_form_validate'
- i18nstrings_form_alter in i18nstrings/
i18nstrings.module - Implementation of hook_form_alter().
File
- i18nstrings/
i18nstrings.module, line 192 - Internationalization (i18n) package - translatable strings.
Code
function i18nstrings_translate_edit_form_validate($form, &$form_state) {
$context = $form_state['values']['i18nstrings_context'];
if (empty($context->format)) {
// If not input format use regular validation for all strings
$copy_state = $form_state;
$copy_state['values']['textgroup'] = 'default';
locale_translate_edit_form_validate($form, $copy_state);
}
elseif (!filter_access($context->format)) {
form_set_error('translations', t('You are not allowed to translate or edit texts with this input format.'));
}
}