diff --git a/config_translation.module b/config_translation.module index 26f06a0..943352e 100644 --- a/config_translation.module +++ b/config_translation.module @@ -267,12 +267,12 @@ function config_translation_config_translation_group_info() { } /** - * Implements hook_entity_operations_alter(). + * Implements hook_entity_operation_alter(). */ -function config_translation_entity_operations_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) { +function config_translation_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) { $uri = $entity->uri(); $operations['translate'] = array( - 'title' => t('Translate badabumm'), + 'title' => t('Translate Less Ugly'), 'href' => $uri['path'] . '/translate', 'weight' => 50, ); @@ -291,18 +291,6 @@ function config_translation_form_alter(&$form, &$form_state, $form_id) { return; } - // Alter the filter admin overview to add translation links. - if ($form_id == 'filter_admin_overview') { - foreach ($form['formats'] as $id => &$format) { - if (is_array($format) && isset($format['operations'])) { - $format['operations']['#links']['translate'] = array( - 'title' => t('Translate'), - 'href' => 'admin/config/content/formats/' . $id . '/translate', - ); - } - } - } - // Alter the user roles form to add translation links. if ($form_id == 'user_admin_roles') { foreach ($form['roles'] as $id => &$role) { @@ -315,6 +303,18 @@ function config_translation_form_alter(&$form, &$form_state, $form_id) { } } + // Alter the taxonomy form to add translation links. + if ($form_id == 'taxonomy_overview_vocabularies') { + foreach ($form as $id => &$vocabulary) { + if (is_array($vocabulary) && isset($vocabulary['operations'])) { + $vocabulary['operations']['#links']['translate'] = array( + 'title' => t('Translate'), + 'href' => 'admin/structure/taxonomy/' . $id . '/translate', + ); + } + } + } + // Alter the blocks form to add translation links. if ($form_id == 'block_admin_display_form') { foreach ($form['blocks'] as $id => &$block) {