diff -u b/core/lib/Drupal/Core/Config/Entity/ConfigEntityOperationsProvider.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityOperationsProvider.php --- b/core/lib/Drupal/Core/Config/Entity/ConfigEntityOperationsProvider.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityOperationsProvider.php @@ -30,7 +30,7 @@ if (isset($info['entity_keys']['status'])) { if ($entity->status()) { $operations['disable'] = array( - 'title' => $this->translationManager->translate('Disable'), + 'title' => $this->t('Disable'), 'href' => $uri['path'] . '/disable', 'options' => $uri['options'], 'weight' => 40, @@ -38,7 +38,7 @@ } else { $operations['enable'] = array( - 'title' => $this->translationManager->translate('Enable'), + 'title' => $this->t('Enable'), 'href' => $uri['path'] . '/enable', 'options' => $uri['options'], 'weight' => -10, diff -u b/core/lib/Drupal/Core/Entity/EntityOperationsProvider.php b/core/lib/Drupal/Core/Entity/EntityOperationsProvider.php --- b/core/lib/Drupal/Core/Entity/EntityOperationsProvider.php +++ b/core/lib/Drupal/Core/Entity/EntityOperationsProvider.php @@ -107,13 +107,13 @@ $uri = $entity->uri(); $operations = array(); $operations['update'] = array( - 'title' => $this->translationManager->translate('Edit'), + 'title' => $this->t('Edit'), 'href' => $uri['path'] . '/edit', 'options' => $uri['options'], 'weight' => 10, ); $operations['delete'] = array( - 'title' => $this->translationManager->translate('Delete'), + 'title' => $this->t('Delete'), 'href' => $uri['path'] . '/delete', 'options' => $uri['options'], 'weight' => 100, @@ -123,2 +123,11 @@ } + + /** + * Translates a string to the current language or to a given language. + * + * This is a wrapper so POTX can use it to extract translatable strings. + */ + protected function t($string, array $args = array(), array $options = array()) { + return $this->translationManager->translate($string, $args, $options); + } } diff -u b/core/modules/menu/lib/Drupal/menu/MenuOperationsProvider.php b/core/modules/menu/lib/Drupal/menu/MenuOperationsProvider.php --- b/core/modules/menu/lib/Drupal/menu/MenuOperationsProvider.php +++ b/core/modules/menu/lib/Drupal/menu/MenuOperationsProvider.php @@ -25,7 +25,7 @@ $operations['update']['title'] = t('Edit menu'); $operations['delete']['title'] = t('Delete menu'); $operations['add'] = array( - 'title' => t('Add link'), + 'title' => $this->t('Add link'), 'href' => $uri['path'] . '/add', 'options' => $uri['options'], 'weight' => 20, diff -u b/core/modules/picture/lib/Drupal/picture/PictureMappingOperationsProvider.php b/core/modules/picture/lib/Drupal/picture/PictureMappingOperationsProvider.php --- b/core/modules/picture/lib/Drupal/picture/PictureMappingOperationsProvider.php +++ b/core/modules/picture/lib/Drupal/picture/PictureMappingOperationsProvider.php @@ -22,7 +22,7 @@ $operations = parent::getDefaultOperations($entity); $uri = $entity->uri(); $operations['duplicate'] = array( - 'title' => t('Duplicate'), + 'title' => $this->t('Duplicate'), 'href' => $uri['path'] . '/duplicate', 'options' => $uri['options'], 'weight' => 15, diff -u b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetOperationsProvider.php b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetOperationsProvider.php --- b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetOperationsProvider.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/ShortcutSetOperationsProvider.php @@ -21,10 +21,10 @@ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $uri = $entity->uri(); - $operations['update']['title'] = t('Edit menu'); + $operations['update']['title'] = $this->t('Edit menu'); $operations['update']['href'] = $uri['path'] . '/edit'; $operations['list'] = array( - 'title' => t('List links'), + 'title' => $this->t('List links'), 'href' => $uri['path'], ); diff -u b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyOperationsProvider.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyOperationsProvider.php --- b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyOperationsProvider.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyOperationsProvider.php @@ -22,16 +22,16 @@ $operations = parent::getDefaultOperations($entity); $uri = $entity->uri(); - $operations['update']['title'] = t('edit vocabulary'); + $operations['update']['title'] = $this->t('edit vocabulary'); $operations['update']['href'] = $uri['path'] . '/edit'; $operations['list'] = array( - 'title' => t('list terms'), + 'title' => $this->t('list terms'), 'href' => $uri['path'], 'options' => $uri['options'], 'weight' => 0, ); $operations['add'] = array( - 'title' => t('add terms'), + 'title' => $this->t('add terms'), 'href' => $uri['path'] . '/add', 'options' => $uri['options'], 'weight' => 10, diff -u b/core/modules/user/lib/Drupal/user/RoleOperationsProvider.php b/core/modules/user/lib/Drupal/user/RoleOperationsProvider.php --- b/core/modules/user/lib/Drupal/user/RoleOperationsProvider.php +++ b/core/modules/user/lib/Drupal/user/RoleOperationsProvider.php @@ -21,7 +21,7 @@ protected function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); $operations['permissions'] = array( - 'title' => t('Edit permissions'), + 'title' => $this->t('Edit permissions'), 'href' => 'admin/people/permissions/' . $entity->id(), 'weight' => 20, );