-
Notifications
You must be signed in to change notification settings - Fork 208
'Excludes' doesn't work for directories. #87
Comments
See #81 |
Thanks for the reply, but it doesn't address my issue. I have defined my root folder. The comment of the excludes array states you can add directories to the array to exclude them. You cannot. This feature does not work. |
Alright, thanks for letting me know |
Looking at the source code (https://github.com/martinlindhe/laravel-vue-i18n-generator/blob/master/src/Generator.php#L56) the generator will only compare filenames ignoring the folder path. |
I'm not working on this code atm, but you are very welcome to submit a PR to fix this. |
Hi @martinlindhe , do you have any guidelines for PRs? |
@karolispx nothing special, just open a PR and we take it from there! |
I took a quick look at this and the code at https://github.com/martinlindhe/laravel-vue-i18n-generator/blob/master/src/Generator.php#L56 is used to exclude directories inside 'resources/lang/' directory, i.e. if you had a few languages: en, ko, ru - you could exclude the whole language directory by adding the folder name to 'excludes' at https://github.com/martinlindhe/laravel-vue-i18n-generator/blob/master/src/config/vue-i18n-generator.php#L41, i.e. The actual problem is not being able to exclude directory from a language folder, i.e. excluding directory '/resources/lang/en/custom' does not work. This function https://github.com/martinlindhe/laravel-vue-i18n-generator/blob/master/src/Generator.php#L259 handles file exclusion so I think appropriatefunction needs to be written for excluding directories and called here https://github.com/martinlindhe/laravel-vue-i18n-generator/blob/master/src/Generator.php#L215 Will take a closer look when I have some time. |
Assuming a directory structure of:
And in the config file:
When
art vue-i18n:generate
is run, then everything insidedirectory_name
will be included in the output file.Placing
directory_name/file_name_2' into the
excludes` array is a workaround, but it doesn't suit my use case.The text was updated successfully, but these errors were encountered: