function tmgmt_local_translation_form_save_as_completed_validate in Translation Management Tool 7
Form validate callback for save as completed submit action.
Verify that all items are translated.
1 string reference to 'tmgmt_local_translation_form_save_as_completed_validate'
- tmgmt_local_translation_form in translators/
tmgmt_local/ includes/ tmgmt_local.pages.inc - Form callback for translating a job item.
File
- translators/
tmgmt_local/ includes/ tmgmt_local.pages.inc, line 186 - Provides page and forms callbacks.
Code
function tmgmt_local_translation_form_save_as_completed_validate($form, &$form_state) {
// Loop over all data items and verify that there is a translation in there.
foreach ($form_state['values'] as $key => $value) {
if (is_array($value) && isset($value['translation'])) {
if (empty($value['translation'])) {
form_set_error($key . '[translation]', t('Missing translation.'));
}
}
}
}