Skip to content

Commit

Permalink
add spin
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jun 20, 2024
1 parent 18b82dc commit 9db9e1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
15 changes: 10 additions & 5 deletions src/Commands/FixGrammarTranslationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Elegantly\Translator\Facades\Translator;
use Illuminate\Console\Command;

use function Laravel\Prompts\spin;

class FixGrammarTranslationsCommand extends Command
{
use TranslatorCommandTrait;
Expand Down Expand Up @@ -45,11 +47,14 @@ public function handle(): int
continue;
}

$translations = Translator::fixGrammarTranslations(
$locale,
$namespace,
$keys,
$service
$translations = spin(
fn () => Translator::fixGrammarTranslations(
$locale,
$namespace,
$keys,
$service
),
'Fetching response...'
);

$this->table(
Expand Down
17 changes: 11 additions & 6 deletions src/Commands/TranslateTranslationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Elegantly\Translator\Facades\Translator;
use Illuminate\Console\Command;

use function Laravel\Prompts\spin;

class TranslateTranslationsCommand extends Command
{
use TranslatorCommandTrait;
Expand Down Expand Up @@ -49,12 +51,15 @@ public function handle(): int
continue;
}

$translations = Translator::translateTranslations(
$from,
$target,
$namespace,
$keys,
$service
$translations = spin(
fn () => Translator::translateTranslations(
$from,
$target,
$namespace,
$keys,
$service
),
'Fetching response...'
);

$this->table(
Expand Down

0 comments on commit 9db9e1a

Please sign in to comment.