Skip to content

Commit 33b4914

Browse files
committed
fix commands
1 parent 673f12b commit 33b4914

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/Commands/FixGrammarTranslationsCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ class FixGrammarTranslationsCommand extends Command
1616
public function handle(): int
1717
{
1818
$serviceArg = $this->option('service');
19-
$localesArg = explode(',', (string) $this->option('locales'));
19+
$localesArg = $this->option('locales');
2020

2121
$service = TranslatorServiceProvider::getGrammarServiceFromConfig($serviceArg);
2222

2323
$locales = collect(Translator::getLanguages())
24-
->when($localesArg, fn (Collection $items) => $items->intersect($localesArg));
24+
->when($localesArg, fn (Collection $items) => $items->intersect(explode(',', $localesArg)));
2525

2626
foreach ($locales as $locale) {
2727

2828
$this->info("Fixing grammar in '{$locale}' locale:");
29-
$this->line('Using service '.get_class($service));
29+
$this->line('Using service :'.get_class($service));
3030

3131
$namespaces = Translator::getNamespaces($locale);
3232

src/Commands/TranslateTranslationsCommand.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ public function handle(): int
1919
$all = (bool) $this->option('all');
2020
$serviceName = $this->option('service');
2121

22-
$service = $serviceName
23-
? TranslatorServiceProvider::getTranslateServiceFromConfig((string) $serviceName)
24-
: null;
22+
$service = TranslatorServiceProvider::getTranslateServiceFromConfig($serviceName);
2523

2624
$namespaces = Translator::getNamespaces($from);
2725

@@ -30,9 +28,7 @@ public function handle(): int
3028
foreach ($targets as $target) {
3129

3230
$this->info("Translating from '{$from}' to '{$target}':");
33-
if ($service) {
34-
$this->line('Using custom service '.get_class($service));
35-
}
31+
$this->line('Using service: '.get_class($service));
3632

3733
foreach ($namespaces as $namespace) {
3834

0 commit comments

Comments
 (0)