FEATURE: extend translation command for translating also templates

This commit is contained in:
Michal Kváček
2016-09-23 22:54:46 +02:00
parent 7589051216
commit 91ef424bd0
3 changed files with 31 additions and 9 deletions
+3 -4
View File
@@ -25,7 +25,6 @@ class Translations extends Command
/**
* Execute the console command.
* @return mixed
*/
public function handle()
{
@@ -33,15 +32,15 @@ class Translations extends Command
$defaultLocales = config('app.fallback_locale');
$currentLocales = config('app.locale');
$defaultLocalesDir = $dir . '/' . $defaultLocales;
$currentLocalesDir = $dir . '/' . $currentLocales;
$defaultLocalesDir = base_path($dir . '/' . $defaultLocales);
$currentLocalesDir = base_path($dir . '/' . $currentLocales);
if (!is_dir($defaultLocalesDir)) {
// this is the place for checking for submodules
$modulePath = dirname(dirname($dir));
if (file_exists($modulePath . '/info.php')) {
if (is_dir(base_path($modulePath . '/Resources/lang'))) {
$modules = File::directories($modulePath);
foreach ($modules as $module) {
$this->call('translate:dir', ['dir' => $module . '/Resources/lang']);