|
4 | 4 |
|
5 | 5 | namespace Drush\Commands\pm; |
6 | 6 |
|
| 7 | +use Drupal; |
7 | 8 | use Drupal\Core\Config\ConfigFactoryInterface; |
8 | 9 | use Drupal\Core\Extension\Extension; |
9 | 10 | use Drupal\Core\Extension\MissingDependencyException; |
|
13 | 14 | use Drupal\Core\Link; |
14 | 15 | use Drupal\Core\Url; |
15 | 16 | use Drupal\user\PermissionHandlerInterface; |
16 | | -use Drupal; |
17 | 17 |
|
18 | 18 | trait PmTrait |
19 | 19 | { |
@@ -78,7 +78,7 @@ public function addUninstallDependencies($modules): false|array |
78 | 78 | $module_data = $this->extensionListModule->reset()->getList(); |
79 | 79 | $module_list = array_combine($modules, $modules); |
80 | 80 | if ($diff = array_diff_key($module_list, $module_data)) { |
81 | | - throw new \Exception(dt('A specified extension does not exist: !diff', ['!diff' => implode(',', $diff)])); |
| 81 | + throw new \Exception(sprintf('A specified extension does not exist: %s', implode(',', $diff))); |
82 | 82 | } |
83 | 83 | $extension_config = $this->configFactory->getEditable('core.extension'); |
84 | 84 | $installed_modules = $extension_config->get('module') ?: []; |
@@ -124,19 +124,19 @@ protected function getModuleLinks(Extension $module): array |
124 | 124 | // implementation exists then the module provides an overview page, rather |
125 | 125 | // than checking to see if the page exists, which is costly. |
126 | 126 | if ($this->moduleHandler->moduleExists('help') && $module->status && $this->moduleHandler->hasImplementations('help', $module->getName())) { |
127 | | - $links[] = Link::fromTextAndUrl(dt('Help'), Url::fromRoute('help.page', ['name' => $module->getName()])); |
| 127 | + $links[] = Link::fromTextAndUrl('Help', Url::fromRoute('help.page', ['name' => $module->getName()])); |
128 | 128 | } |
129 | 129 |
|
130 | 130 | // Generate link for module's permissions page. |
131 | 131 | // Avoid DI for PermissionHandler until we understand better at https://github.com/drush-ops/drush/issues/6154. |
132 | 132 | if ($module->status && Drupal::service(PermissionHandlerInterface::class)->moduleProvidesPermissions($module->getName())) { |
133 | | - $links[] = Link::fromTextAndUrl(dt('Permissions'), Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()])); |
| 133 | + $links[] = Link::fromTextAndUrl('Permissions', Url::fromRoute('user.admin_permissions.module', ['modules' => $module->getName()])); |
134 | 134 | } |
135 | 135 |
|
136 | 136 | // Generate link for module's configuration page, if it has one. |
137 | 137 | if ($module->status && isset($module->info['configure'])) { |
138 | 138 | $route_parameters = $module->info['configure_parameters'] ?? []; |
139 | | - $links[] = Link::fromTextAndUrl(dt('Configure'), Url::fromRoute($module->info['configure'], $route_parameters)); |
| 139 | + $links[] = Link::fromTextAndUrl('Configure', Url::fromRoute($module->info['configure'], $route_parameters)); |
140 | 140 | } |
141 | 141 |
|
142 | 142 | return $links; |
|
0 commit comments