Skip to content

Commit 2b26c09

Browse files
leo108martinlindhe
authored andcommitted
Add excludes config (martinlindhe#68)
* Add excludes config
1 parent a1cbc8b commit 2b26c09

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

src/Commands/GenerateInclude.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public function handle()
3939
->generateMultiple($root, $umd);
4040

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

45-
exit();
45+
return;
4646
}
4747

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

5454
if ($config['showOutputMessages']) {
55-
echo "Written to " . $jsFile . PHP_EOL;
55+
$this->info("Written to : ".$jsFile);
5656
}
5757
}
5858
}

src/Generator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ private function allocateLocaleArray($path)
208208
continue;
209209
}
210210

211-
if (isset($this->config['langFiles']) && !empty($this->config['langFiles']) && !in_array($noExt, $this->config['langFiles'])) {
211+
if ((isset($this->config['langFiles']) && !empty($this->config['langFiles']) && !in_array($noExt, $this->config['langFiles']))
212+
|| (isset($this->config['excludes']) && in_array($noExt, $this->config['excludes']))
213+
) {
212214
continue;
213215
}
214216

src/config/vue-i18n-generator.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@
3030
*/
3131
],
3232

33+
/*
34+
|--------------------------------------------------------------------------
35+
| Excluded files
36+
|--------------------------------------------------------------------------
37+
|
38+
| Exclude translation files you don't need.
39+
|
40+
*/
41+
'excludes' => [
42+
/*
43+
'validation',
44+
*/
45+
],
46+
3347
/*
3448
|--------------------------------------------------------------------------
3549
| Output file

0 commit comments

Comments
 (0)