Open momente-organisieren opened 3 years ago
The workaround that worked at least to have the views, but is kinda fiddly has been:
mv resources/views/vendor/$the-package-name resources/views/$the-package-name
JsonArrayFileTranslator
to write to a seperate directory (e.g. lang/test/lang.json)php artisan translate:files
mv resources/views/$the-package-name resources/views/vendor/$the-package-name
done
on that journey another fine option would be to specify only a source lang.json and to skip the whole file reader work that parses views and controllers .. maybe as a Console Command flag
The problem here is that it ignores any(?) directory named "vendor"
In /src/TranslationFileTranslators/JsonArrayFileTranslator.php line 103 replace the line below and it will work
$finder->in(base_path())->exclude('storage')->exclude('vendor')->in(base_path().DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.'vendor')->name('*.php')->name('*.twig')->name('*.vue')->files();
There's a security issue here that needs to be applied immediately 0777 permission is too open https://github.com/tanmuhittin/laravel-google-translate/pull/58/files#diff-227ca57210f13336f78c103af73ea7fd5f5cf04337a0425a827acce83cbe51b5L62
Is there any workaround using php files?
Is there any workaround using php files?
you can use my PR here https://github.com/tanmuhittin/laravel-google-translate/issues/44#issuecomment-2057909266
@itsrexb Does it work with the .php
extension inside the lang/vendor/filament-actions/en
directory?
proposed outcome
additional notes
laravel doc suggests to publish vendor packages to resources/lang/vendor/$vendor/lang.json
translations genarated by
laravel-google-translate
that have been read from `resources/vendor/$package/lang.json should also be written to this target.now only lang/lang.json is supported and used
JsonArrayFileTranslator.php#L46