brunoscode/laravel-translation-handler
A Laravel package for handling application translations, offering tools to manage and work with language files in your project.
import/export/sync call, so the decision "where do translations live?" becomes reversible. That is a roadmap de-risker: you can ship on file-based translations now and migrate to DB-backed translations later without a rewrite.__() key scanner — realistically 1–3 weeks of engineering, then perpetual maintenance as formats and frameworks drift. At MIT license and zero integration cost beyond composer require + config publish, this is a clear "buy" (adopt) unless you already own a TMS integration.set/listTranslations/deleteGroup + the swappable dbHandlerClass gives you a programmatic backend for an internal editor without designing a storage layer. Useful for deciding if a "translations admin page" is a small internal tool (build on this) or a product surface (buy a TMS).check-translations-tool / translation-handler:check reports keys referenced in code but undefined, per side and locale, with orphans: true for defined-but-unused keys. That converts "is localization done?" from a QA opinion into a pass/fail gate you can put in CI before a launch or a new-market release. Directly supports go/no-go decisions for localization launches.listGroups, whereGroupIn, and per-locale CSV export let you estimate scope ("how many keys exist in auth, validation, messages?") and hand translators exactly one locale's strings as CSV — a concrete input to costing a market expansion.db, sync to files once at the end) means agent-driven edits don't cause N full-file rewrites. This is a credible, low-commitment pilot for AI in the dev workflow — you can trial it on one feature's strings and measure time-to-localized without a platform purchase.check.backend = app, resources/views, routes, database + .php; check.frontend = resources/js + .ts/.tsx/.js/.jsx). If your product has both, that per-side breakdown tells you which side is the actual source of missing-copy bugs — a fact you can act on.setOption(). That means "adopt now" doesn't commit you to this package's file layout — custom FileHandlerInterface / DatabaseHandlerInterface implementations and a TranslationChecker subclass with custom patternsFor() regexes cover non-standard key conventions.Adopt-trial when:
laravel/boost v2 and want to pilot agent-driven translation edits with a sane write pattern (DB-first, sync at the end).Look elsewhere when:
2026-10-21, which is not a date you can verify against a shipped artifact — treat version history as unconfirmed and pin an exact version in composer.json with a lock file. Do a code read before merging; there is no community backstop.spatie/laravel-translation-loader.Mitigations if you proceed: MIT + swappable handlers means exit cost is low — worst case you keep the data, drop the package. Pin the version, wrap calls behind your own service class, and add the check command to CI so a future removal is caught by failing builds.
For executives (one paragraph): Localization is currently a manual, error-prone process: strings live in more than one place, nobody can say with certainty whether every string on a page is translated, and preparing files for translators is handwork. This package is an MIT-licensed Laravel library that makes translation storage formats interchangeable, gives us an automated audit of missing translations we can run before every release, and exports a single language as a spreadsheet for translators. It also plugs into our AI coding tooling so agents can localize a whole feature in one pass. The cost is a Composer dependency and a config file; the risk is maturity — it has no adoption yet, so we would use it behind our own wrapper, pin the version, and treat it as reversible. Concrete asks: approve a one-sprint trial scoped to one feature and one pre-release gate, with a go/no-go on measured missing-key count before and after.
For engineering (one paragraph): It's a facade plus four storage handlers — php_file, json_file, csv_file, db — with import/export/sync/get/set/find/listTranslations/deleteKey/deleteGroup/sortKeys and equivalent Artisan commands. TranslationCollection gives chainable filters (whereLocale, whereGroup, whereValueContains) and merge semantics (addTranslations skips existing key+locale, replaceTranslations overwrites). The real win is check, which regex-scans configured paths and extensions per side (backend PHP, frontend TS/JS) for __()/trans() usage and reports referenced-but-undefined keys plus optional orphans; scan paths, extensions, and the extraction regexes themselves are configurable or overridable via a TranslationChecker subclass. Everything — all four handlers and the checker — is swappable via config or setOption(), so we can back it with our own table or key convention. Important operational detail: file formats rewrite the entire file per write, so batch multi-key edits into db and sync to files once. Boost v2 auto-registers MCP tools with no config. Caveats to weigh: zero stars, zero dependents, single maintainer, unconfirmed release history — pin the version and wrap the facade so removal is a one-file change.
How can I help you explore Laravel packages today?