Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Add excludes config (#68)
Browse files Browse the repository at this point in the history
* Add excludes config
  • Loading branch information
leo108 authored and martinlindhe committed Nov 28, 2018
1 parent a1cbc8b commit 2b26c09
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Commands/GenerateInclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public function handle()
->generateMultiple($root, $umd);

if ($config['showOutputMessages']) {
echo "Written to :" . PHP_EOL . $files . PHP_EOL;
$this->info("Written to : ".$files);
}

exit();
return;
}

$data = (new Generator($config))
Expand All @@ -52,7 +52,7 @@ public function handle()
file_put_contents($jsFile, $data);

if ($config['showOutputMessages']) {
echo "Written to " . $jsFile . PHP_EOL;
$this->info("Written to : ".$jsFile);
}
}
}
4 changes: 3 additions & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ private function allocateLocaleArray($path)
continue;
}

if (isset($this->config['langFiles']) && !empty($this->config['langFiles']) && !in_array($noExt, $this->config['langFiles'])) {
if ((isset($this->config['langFiles']) && !empty($this->config['langFiles']) && !in_array($noExt, $this->config['langFiles']))
|| (isset($this->config['excludes']) && in_array($noExt, $this->config['excludes']))
) {
continue;
}

Expand Down
14 changes: 14 additions & 0 deletions src/config/vue-i18n-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
*/
],

/*
|--------------------------------------------------------------------------
| Excluded files
|--------------------------------------------------------------------------
|
| Exclude translation files you don't need.
|
*/
'excludes' => [
/*
'validation',
*/
],

/*
|--------------------------------------------------------------------------
| Output file
Expand Down

0 comments on commit 2b26c09

Please sign in to comment.