- Does th/translation-log-bundle work with Laravel?
- No. It is a Symfony bundle built on the Symfony service container, compiler passes, and translation component events, none of which Laravel exposes. There is no service provider and no discoverable listener, so installing it would register nothing in a Laravel application. Treat it as a reference implementation of the pattern rather than an install candidate.
- How do I log missing translation keys in Laravel?
- Reimplement the pattern in roughly 80 lines as a small internal package. The recommended seam is a decorator bound over Illuminate\Contracts\Translation\Translator in a service provider, which stays version-safe across framework minors. The decorator calls the underlying translator, records the key, locale, and whether the result fell back, then delegates the return value untouched.
- Should I use a missing-translation event listener or a translator decorator in Laravel?
- The decorator is the safer choice because Laravel's missing-translation event surface has moved between versions and needs verification per minor release. A decorator bound over the translator contract does not depend on that event being dispatched and is easy to unit test. Only choose the event listener if you have confirmed on your pinned framework versions that the event fires reliably in every code path you care about.
- Is th/translation-log-bundle safe to add as a Composer dependency?
- The project shows zero stars and zero dependents, so there is no downstream validation, no issue history, and no security response path. That is a supply-chain liability attached to a logging convenience, and the blast radius of not using it is zero. Composer resolution against PHP 8.1+ and Laravel 10 or 11 will also almost certainly fail on constraints.
- Can I fork th/translation-log-bundle instead of reimplementing it in Laravel?
- There is no upgrade or migration path from a Symfony 2-era bundle to a Laravel package, so a fork would mean rewriting the integration layer anyway. If the original source has a reusable idea such as key de-duplication, read it under its license, cite it, and move on. Frame the work to stakeholders as reimplementing the pattern, never forking the dependency.
- What should I log for each translation lookup or missing key?
- At minimum log the key, locale, environment, release, and route so misses are attributable. Distinguish a genuine miss from a silent English fallback, since they have different fixes. Decide early whether the data feeds a localization vendor such as Phrase, Lokalise, or Crowdin, or an internal lang sync pipeline, because that choice shapes the schema.
- Will logging every translation lookup slow down my Laravel app or flood my logs?
- The logger sits on the hot path of every translation call, so its failure modes, including exceptions, PII in logs, and log floods, become your risk. Send records to a dedicated Monolog channel or structured JSON in the aggregator, and set retention deliberately. If volume is nontrivial, sample full lookups from day one and always record misses.
- Do I need runtime translation logging if I already run CI key-diff or static extraction checks?
- Build-time coverage catches unused and missing keys statically and is cheaper, so start there if you do not have it. Runtime logging is the complement: it shows which keys are actually requested in production and which fall back for real users in non-primary locales. Fund both only if there is a named owner who triages misses weekly.
- Which PHP and Laravel versions should an internal translation-audit package target?
- Pin PHP 8.1 through 8.3 and Laravel 10 and 11 before the build starts. Run PHPUnit against both framework minors so a change in the translator contract or event surface is caught in CI. Publish a tagged version rather than dev-main, and keep a one-page README naming the owner and the triage workflow.
- How do I test a Laravel translation logging decorator?
- Bind the decorator over a fake or the real translator in a service provider within the test, then assert the recorded payload for a hit, a miss, and a fallback, and assert the returned string is unchanged. Also test that a logging failure does not break translation output. Run the suite on both Laravel 10 and 11 to catch contract drift.