-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added add-terms command to only upload and not sync terms
- Loading branch information
Henrik B Hansen
committed
Sep 21, 2020
1 parent
65f77ec
commit 3a9d0ed
Showing
4 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Vemcogroup\Translation\Commands; | ||
|
||
use Exception; | ||
use Illuminate\Console\Command; | ||
use Vemcogroup\Translation\Translation; | ||
|
||
class AddTerms extends Command | ||
{ | ||
protected $signature = 'translation:add-terms | ||
{--scan : Whether the job should scan before uploading} | ||
'; | ||
|
||
protected $description = 'Upload all terms to POEditor'; | ||
|
||
public function handle(): void | ||
{ | ||
try { | ||
$this->info('⬆️ Preparing to upload terms'); | ||
|
||
if ($this->option('scan')) { | ||
$this->call('translation:scan'); | ||
} | ||
|
||
app(Translation::class)->addTerms(); | ||
|
||
$this->info('⬆️ Finished uploading all terms'); | ||
} catch (Exception $e) { | ||
$this->error($e->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters