diff --git a/config_translation.module b/config_translation.module index 943352e..33f4608 100644 --- a/config_translation.module +++ b/config_translation.module @@ -272,7 +272,7 @@ function config_translation_config_translation_group_info() { function config_translation_entity_operation_alter(array &$operations, \Drupal\Core\Entity\EntityInterface $entity) { $uri = $entity->uri(); $operations['translate'] = array( - 'title' => t('Translate Less Ugly'), + 'title' => t('Translate'), 'href' => $uri['path'] . '/translate', 'weight' => 50, ); @@ -291,6 +291,18 @@ 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) { @@ -366,20 +378,6 @@ function config_translation_page_alter(&$page) { $first_key = reset($row_keys); $rows = &$content['content'][0]['#rows']; - // Fingerprint the contact module entity list page structure. - // No good ID to match for unlike views, but we can reasonably be sure - // with checking for category and recipients. - if (isset($rows[$first_key]['category']) && - isset($rows[$first_key]['recipients']) - ) { - foreach ($rows as $id => &$row) { - $row['operations']['data']['#links']['translate'] = array( - 'title' => t('Translate'), - 'href' => 'admin/structure/contact/manage/' . $id . '/translate', - ); - } - } - // Fingerprint the menu summary table structure. if (isset($rows[$first_key]['title']['class']) && in_array('menu-label', $rows[$first_key]['title']['class'])) {