simonet85/laravel-deepl
Laravel integration for the DeepL translation API. Add your API key via config, then translate text between supported languages from your application using a simple, framework-friendly wrapper around DeepL's translation endpoints, including source and target language selection.
php artisan deepl:translate {locale} backfills lang/{locale}.json, so the question shifts from "can we afford translators for locale X?" to "is a machine-translated first pass good enough to ship in locale X?" — a much cheaper question to answer per market.deeplcom/deepl-php SDK: facade, cache, placeholder protection, two artisan commands. The realistic build alternative is ~150–300 lines of internal glue plus on-call ownership. Buying the package (free, OSS) is the obvious call unless you already run a translation management system.php artisan deepl:usage reports monthly character consumption, you can attach a real cost estimate to "ship locale Y" and to "add these 40 new strings next sprint." Localization stops being an unbudgeted surprise.--dry-run and --force) means every feature release can carry its own string delta into all locales as a CI/pre-release step, instead of batching localization into a quarterly project. --scan= plus harvesting keys from all lang/*.json covers dynamically constructed keys, which is the usual reason localization drifts.:count etc.) and escaping of & < > remove the most common class of translated-UI regressions, so QA sign-off on a new locale doesn't require a bespoke regression pass.:fx) vs. Pro key detection means pilots can run on the free tier before any procurement, which is a useful de-risking step for a "prove the market first" roadmap bet.Good fit when:
lang files — this package's whole model assumes that.deepl:usage check.Look elsewhere when:
Adoption caveats to state explicitly: v1.0.0 is the first public release, so treat the facade surface as stable-in-intent but not battle-tested; pin the version. The --scan= heuristic parses source for keys, which can over-collect and inflate spend — always run --dry-run first and inspect the diff. And "configured context/formality" is a quality dial, not a substitute for review on customer-facing copy.
To executives: Localization is currently gated on human translator cost and scheduling, which makes each new market a slow, expensive bet. This package turns it into a per-locale operating cost we can measure before committing: a free-tier pilot, an exact monthly character quota we can monitor via php artisan deepl:usage, and no charge for re-translating strings we've already translated. It does not replace professional translation for brand, legal, or checkout copy — it lets us spend that budget only where it changes outcomes, and it makes shipping a "good enough" locale a decision we can reverse cheaply.
To engineering: Small, boring, low-risk addition. It's a thin wrapper over DeepL's official PHP SDK — a DeepL facade (translate(), usage()), a translation cache, protection for Laravel :placeholders and & < >, and two commands: deepl:translate {locale} to backfill missing keys (with --dry-run, --force, --scan=) and deepl:usage for monthly consumption. Batches 50 strings per request, auto-detects Free vs. Pro keys. Requires PHP 8.2+ and Laravel 11–13; install is composer require plus an optional config publish. Work needed from us: API key in secrets, a cache store with a sane TTL, and wiring deepl:translate --dry-run into the pre-release checklist before it becomes automatic. Version-pin it — it's a fresh v1.0.0 with a single maintainer, so the integration should stay behind a thin seam we could fork if needed.
How can I help you explore Laravel packages today?