This repository was archived by the owner on Jul 16, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ class GenerateInclude extends Command
26
26
*/
27
27
public function handle ()
28
28
{
29
- $ root = base_path () . ' /resources/lang ' ;
29
+ $ root = base_path () . config ( ' vue-i18n-generator.langPath ' ) ;
30
30
31
31
$ data = (new Generator )
32
32
->generateFromPath ($ root );
33
33
34
- $ jsFile = base_path () . ' /resources/assets/js/ vue-i18n-locales.generated.js ' ;
34
+ $ jsFile = base_path () . config ( ' vue-i18n-generator.jsFile ' ) ;
35
35
36
36
file_put_contents ($ jsFile , $ data );
37
37
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ public function boot()
25
25
$ this ->commands (
26
26
'vue-i18n.generate '
27
27
);
28
+
29
+ $ this ->publishes ([
30
+ __DIR__ .'/config/vue-i18n-generator.php ' => config_path ('vue-i18n-generator.php ' ),
31
+ ]);
32
+
28
33
}
29
34
30
35
/**
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ return [
4
+ /*
5
+ |--------------------------------------------------------------------------
6
+ | Laravel translations path
7
+ |--------------------------------------------------------------------------
8
+ |
9
+ | The default path where the translations are stored by Laravel.
10
+ | Note: the path will be prepended to point to the App directory.
11
+ |
12
+ */
13
+
14
+ 'langPath ' => '/resources/lang ' ,
15
+
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ | Output file
20
+ |--------------------------------------------------------------------------
21
+ |
22
+ | The javascript path where I will place the generated file.
23
+ | Note: the path will be prepended to point to the App directory.
24
+ |
25
+ */
26
+
27
+ 'jsFile ' => '/resources/assets/js/vue-i18n-locales.generated.js '
28
+ ];
You can’t perform that action at this time.
0 commit comments