Skip to content

v2.4.0 — Translations check command

Latest

Choose a tag to compare

@BrunosCode BrunosCode released this 04 Jun 14:47
· 2 commits to main since this release

Added

  • translation-handler:check — Scans backend PHP and frontend JS/TS source for translation usages (__(), trans(), trans_choice(), Lang::get(), @lang, and t() / i18next.t()) and reports keys referenced in code but not defined per locale. Returns a non-zero exit code when keys are missing, so it works as a CI gate. Supports --locale, --side, --show-keys, and --orphans. Defined keys are read from the chosen format and scoped to the configured fileNames.
  • check-translations-tool — MCP tool exposing the same check to AI agents via Laravel Boost. Returns a structured per-side, per-locale report with passed / totalMissing and optional orphan keys.
  • TranslationChecker — reusable class (and TranslationHandler::check() facade method) holding the source-scanning and missing/orphan logic shared by the command and the MCP tool.
  • check config entry — configurable scan paths and extensions per side. The keys of check define the sides to scan (backend / frontend by default, renamable/extendable); the array structure is validated generically in TranslationOptions, and the command/tool derive the available sides from the config rather than a hard-coded list.
  • Per-side patterns config — each check side may declare patterns.static / patterns.dynamic regexes to override the bundled extraction patterns without subclassing. Patterns are validated to be compilable regexes; when omitted, the built-in defaults are used.
  • checkerClass config entry — for deeper customisation, swap in a subclass of TranslationChecker.

Full Changelog: v2.3.0...v2.4.0