FEATURE: add translation command into Artisan

This commit is contained in:
Michal Kváček
2016-07-21 22:46:48 +02:00
parent fc88a82888
commit 949b1f7c61
3 changed files with 243 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
class TranslateAll extends Command
{
/**
* The name and signature of the console command.
* @var string
*/
protected $signature = 'translate:all';
/**
* The console command description.
* @var string
*/
protected $description = 'Checks for missing translations in all modules.';
/**
* Create a new command instance.
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
* @return mixed
*/
public function handle()
{
$this->call('translate:dir', ['dir' => 'resources/lang']);
$modules = File::directories('modules');
foreach ($modules as $module) {
$this->call('translate:dir', ['dir' => $module.'/Resources/lang']);
}
}
}