- Is incenteev/translation-checker-bundle compatible with Laravel?
- No, it is a Symfony bundle rather than a Laravel package. It registers through Kernel::getBundles(), ships a Symfony Console command named translation:check, and extracts keys from Twig templates and Symfony's translator service. Laravel uses a different container, has no bundle registry, and renders Blade instead of Twig, so the package will not boot as-is in a Laravel application.
- What does incenteev/translation-checker-bundle actually check?
- It scans Symfony templates and code for translation keys and compares them against your translation files. It reports unused keys, missing translations, and inconsistent messages across locales. The goal is to keep language files clean and complete as an application grows.
- Can I install incenteev/translation-checker-bundle in a Laravel app with Composer?
- You can vendor the code, but Composer installation does not make it work in Laravel because there is no Symfony bundle registration or Twig extractor. Its Symfony-versioned dependency constraints may also conflict with a Laravel composer.json. Isolate any trial in a separate directory or CI job so you do not disturb the main lockfile.
- How do I check for unused translation keys in Laravel?
- There is no drop-in Laravel integration here, so you either port the checker logic or build a small Artisan command. A practical command would scan for __(), @lang, trans(), trans_choice(), Blade directives, and JS-side keys, then diff that key set against the files in lang/. The reusable part of this package is the comparison idea, not the Symfony integration surface.
- Why does the translation checker report keys that are actually used?
- Static extraction cannot resolve dynamically constructed keys such as __('errors.' . $code) or keys assembled in JavaScript. Those false positives are inherent to this approach and can erode trust if the check becomes a hard CI gate immediately. Triage the noise, maintain an ignore list, and run the check as warn-only until you understand the baseline.
- Which Laravel versions does incenteev/translation-checker-bundle support?
- It does not target Laravel versions at all because it is versioned for Symfony. You still need to check its PHP floor and ceiling against your application runtime. Treat its Composer constraints as irrelevant or potentially hostile to a Laravel project and avoid mixing it into your main dependency graph.
- Is incenteev/translation-checker-bundle actively maintained?
- The maintenance signal is weak: roughly 36 stars, zero dependents, and no downstream validation. The stated last release date is anomalous relative to the current date, so verify it on Packagist before relying on it. Upstream is unlikely to add Laravel or Blade support, so adopting it effectively transfers ownership to your team.
- What are Laravel-native alternatives to a Symfony translation checker bundle?
- The realistic options are a roughly 200-line custom Artisan command, a Laravel-native package if one fits your workflow, or a managed translation QA service. Choose based on the actual pain: missing keys, unused keys, or inconsistent locale coverage. Given this package's low ecosystem signal, an in-house command may be cheaper than a port.
- How should I integrate translation key checks into Laravel CI?
- Build or port a command such as translations:audit with options like --missing, --unused, and --locale=, and return a non-zero exit code when the chosen check fails. Wire it into CI as warn-only for a couple of sprints to establish a noise baseline. Then promote missing-key detection to a blocking gate while keeping unused-key reporting advisory.
- How do I handle dynamic translation keys like __('errors.' . $code) in static extraction?
- You generally cannot resolve them statically, so accuracy will be capped for heavily dynamic codebases. Use allowlists or ignore patterns, feed the checker a pre-built key list where possible, and scope checks to static keys. Keep dynamic-key findings out of the blocking gate until they are manually triaged.