Skip to content

Commit a99561f

Browse files
authored
Remove dt() usage from config commands (#6506)
1 parent e7cffc7 commit a99561f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/Commands/config/ConfigPullCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ public function doExecute(InputInterface $input, OutputInterface $output): Prope
8585
'yes' => null,
8686
'format' => 'string',
8787
];
88-
$this->logger->notice(dt('Starting to export configuration on :source.', [':source' => $source]));
88+
$this->logger->notice('Starting to export configuration on {source}.', ['source' => $source]);
8989
$process = $this->processManager->drush($sourceRecord, ConfigExportCommand::NAME, [], $export_options + $global_options);
9090
$process->mustRun();
9191

9292
if ($this->drushConfig->simulate()) {
9393
$export_path = '/simulated/path';
9494
} elseif (empty(trim($process->getOutput()))) {
95-
throw new \Exception(dt('The Drush config:export command did not report the path to the export directory.'));
95+
throw new \Exception('The Drush config:export command did not report the path to the export directory.');
9696
} else {
9797
// Trailing slash ensures that we transfer files and not the containing dir.
9898
$export_path = trim($process->getOutput()) . '/';
@@ -108,10 +108,10 @@ public function doExecute(InputInterface $input, OutputInterface $output): Prope
108108
$runner = $sourceRecord->isRemote() && $destinationRecord->isRemote() ? $destinationRecord : $this->siteAliasManager->getSelf();
109109
}
110110
$this->logger
111-
->notice(dt('Starting to rsync configuration files from !source to !dest.', [
112-
'!source' => "$source:$export_path",
113-
'!dest' => $destinationHostPath->getOriginal(),
114-
]));
111+
->notice('Starting to rsync configuration files from {source} to {dest}.', [
112+
'source' => "$source:$export_path",
113+
'dest' => $destinationHostPath->getOriginal(),
114+
]);
115115
$args = ["$source:$export_path", $destinationHostPath->getOriginal()];
116116
$options_double_dash = [
117117
'remove-source-files' => true,

src/Commands/config/ConfigSetCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
9090
$new_key = $config->get($key) === null;
9191
$simulate = $this->drushConfig->simulate();
9292

93-
if ($key == '?' && !empty($data) && $io->confirm(dt('Do you want to update or set multiple keys on !name config.', ['!name' => $config_name]))) {
93+
if ($key == '?' && !empty($data) && $io->confirm(sprintf('Do you want to update or set multiple keys on %s config.', $config_name))) {
9494
foreach ($data as $data_key => $val) {
9595
$config->set($data_key, $val);
9696
}
@@ -99,11 +99,11 @@ public function execute(InputInterface $input, OutputInterface $output): int
9999
}
100100
} else {
101101
$confirmed = false;
102-
if ($config->isNew() && $io->confirm(dt('!name config does not exist. Do you want to create a new config object?', ['!name' => $config_name]))) {
102+
if ($config->isNew() && $io->confirm(sprintf('%s config does not exist. Do you want to create a new config object?', $config_name))) {
103103
$confirmed = true;
104-
} elseif ($new_key && $io->confirm(dt('!key key does not exist in !name config. Do you want to create a new config key?', ['!key' => $key, '!name' => $config_name]))) {
104+
} elseif ($new_key && $io->confirm(sprintf('%s key does not exist in %s config. Do you want to create a new config key?', $key, $config_name))) {
105105
$confirmed = true;
106-
} elseif ($io->confirm(dt('Do you want to update !key key in !name config?', ['!key' => $key, '!name' => $config_name]))) {
106+
} elseif ($io->confirm(sprintf('Do you want to update %s key in %s config?', $key, $config_name))) {
107107
$confirmed = true;
108108
}
109109
if ($confirmed && !$simulate) {

src/Commands/config/ConfigTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static function copyConfig(StorageInterface $source, StorageInterface $de
8787
try {
8888
$destination->write($name, $source->read($name));
8989
} catch (\TypeError $e) {
90-
throw new \Exception(dt('Source not found for @name.', ['@name' => $name]), $e->getCode(), $e);
90+
throw new \Exception(sprintf('Source not found for %s.', $name), $e->getCode(), $e);
9191
}
9292
}
9393

0 commit comments

Comments
 (0)