Open SDJeff opened 5 years ago
How does your vue-i18n:generate config look? Seems to me that you try to run it pointing to your app source folder rather than the language files from the backtrace you posted.
vue-i18n:generate should not be processing your models.
I am having the same issue and I am using the default configuration file (only switched vue-i18n to vuex-i18n), the config file contains:
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel translations path
|--------------------------------------------------------------------------
|
| The default path where the translations are stored by Laravel.
| Note: the path will be prepended to point to the App directory.
|
*/
'langPath' => '/resources/lang',
/*
|--------------------------------------------------------------------------
| Laravel translation files
|--------------------------------------------------------------------------
|
| You can choose which translation files to be generated.
| Note: leave this empty for all the translation files to be generated.
|
*/
'langFiles' => [
/*
'pagination',
'passwords'
*/
],
/*
|--------------------------------------------------------------------------
| Excluded files & folders
|--------------------------------------------------------------------------
|
| Exclude translation files, generic files or folders you don't need.
|
*/
'excludes' => [
/*
'validation',
'example.file',
'example-folder',
*/
],
/*
|--------------------------------------------------------------------------
| Output file
|--------------------------------------------------------------------------
|
| The javascript path where I will place the generated file.
| Note: the path will be prepended to point to the App directory.
|
*/
'jsPath' => '/resources/js/langs/',
'jsFile' => '/resources/js/vue-i18n-locales.generated.js',
/*
|--------------------------------------------------------------------------
| i18n library
|--------------------------------------------------------------------------
|
| Specify the library you use for localization.
| Options are vue-i18n or vuex-i18n.
|
*/
'i18nLib' => 'vuex-i18n',
/*
|--------------------------------------------------------------------------
| Output messages
|--------------------------------------------------------------------------
|
| Specify if the library should show "written to" messages
| after generating json files.
|
*/
'showOutputMessages' => false,
/*
|--------------------------------------------------------------------------
| Escape character
|--------------------------------------------------------------------------
|
| Allows to escape translations strings that should not be treated as a
| variable
|
*/
'escape_char' => '!',
];
I got the same issue, and I figured it out. This is NOT a bug. Btw, thank Martin for the plugin.
Root cause: config was not loaded into cache, thus, the Generator look up into the App folder.
Solution: just run php artisan config:cache
then try again.
I have a Laravel 6 Porject with very easy Models. But the generation stops because of a model with:
Why is stoping at a model when it points to 'resources/lang' folder?