function lingotek_grid_action_options in Lingotek Translation 7.6
Same name and namespace in other branches
- 7.7 lingotek.bulk_grid.inc \lingotek_grid_action_options()
1 call to lingotek_grid_action_options()
File
- ./
lingotek.bulk_grid.inc, line 324
Code
function lingotek_grid_action_options($entity_type) {
$delete_text = $entity_type == 'config' ? t('Delete selected translations') : t('Delete selected content');
$action_options = array(
'select' => t('Select an action'),
'upload' => t('Upload source for translation'),
'sync' => t('Check progress of translations'),
'reset' => t('Disassociate translations'),
'delete' => $delete_text,
);
if ($entity_type == 'config') {
$action_options[t('Download')] = array(
'download_all' => t('Download All Translations'),
);
}
else {
$action_options['edit'] = t('Edit translation settings');
$api = LingotekApi::instance();
$workflows = $api
->listWorkflows();
if (is_array($workflows) && count($workflows) > 1) {
$action_options['workflow'] = t('Change workflow');
}
$action_options[t('Download')] = array(
'download_all' => t('Download All Translations'),
);
}
$target_languages_raw = Lingotek::getLanguages();
foreach ($target_languages_raw as $target_raw) {
$action_options[t('Download')]['download_' . $target_raw->lingotek_locale] = t('Download') . ' ' . t($target_raw->name) . ' (' . $target_raw->lingotek_locale . ') ' . t('Translation');
}
return $action_options;
}