Open mitchellklijs opened 6 years ago
I see you've already started on this in https://github.com/stevegrunwell/lost-in-translation/pull/5. Maybe it still helps ;)
This definitely helps, and I appreciate you digging in. Things have been a bit bonkers lately, but I'm hoping to circle back around to this work soon!
Any news?
Am I correct to assume this package to be abandoned?
It's not abandoned, but definitely in need of some love — really, a full rewrite. It's still on my radar for the near-future, but this last two years has been a helluva decade 🙃
Hi,
Thanks for the great package! I've used it with much pleasure in a couple of projects.
However, when upgrading my projects to Laravel 5.6 I noticed that this package doens't play nice with it due to the new way logging works with Laravel (https://laravel.com/docs/5.6/logging). I got the following error every time a missing translation was found:
Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to undefined method Monolog\Logger::useFiles()"
.After some debugging; I found out a way to fix this. The new logging method (using Monolog) doesn't allow for changing the file "on the fly" anymore. This is not the intended use of the new logging system. Therefore, the issue originates in the
Translator.php
file on line 71 where the logging file location is changed (https://github.com/stevegrunwell/lost-in-translation/blob/develop/src/Translator.php#L71).This could be fixed by changing the
logMissingTranslation
method to:and adding the following to the
channels
array of theconfig/logging.php
configuration file:I started making a PR for this. When creating this PR (and modifying the README) I noticed that some of the functionality of this package can (and should?) now be handled by the new Laravel Logging. The
MissingTranslationException
can be added to a stack channel in thechannels
array of theconfig/logging.php
configuration file. Furthermore, extending the logging can be make use of the new system as well. The whole Event based approach can be replaced by making use of custom Monolog Handler Channels (https://laravel.com/docs/5.6/logging#creating-monolog-handler-channels).So I started making a small PR but quickly noticed that the whole package could be refactored, benefiting from the new logging system. With such a big change it could be very useful to discuss it first before making the changes. So I'ld like to hear what you think.