jayesh/laravel-gemini-translator
An interactive Artisan command and browser Translation Manager that scan Laravel projects for translation keys and generate language files with Gemini AI. Includes lang-pack support, concurrency, four sync modes, and script-fault highlighting. Review AI output before shipping.
Localization roadmap and market sequencing
--dry-run against the existing codebase to get an actual count of untranslated keys per locale. That number becomes the input to a build-vs-buy-vs-outsource decision rather than a guess.Build vs. buy on the i18n toolchain
Feature and scope decisions
--skip-existing makes incremental localization a per-sprint activity rather than a release-blocking project. That directly enables "localize as you build" as a team policy, which is a process decision, not just a tooling one.nwidart/laravel-modules) is a scoping signal: if the codebase is a modular monolith, this package consolidates module strings into one place, which reduces the number of surfaces a future TMS migration has to cover.Engineering investment and sequencing
lang/ PHP and JSON files, there is no lock-in at the data layer. The decision is reversible, which means it can be made early and cheaply and revisited after the first market data lands.Cost and risk modeling
Strong fit
__(), @lang(), trans_choice(), or Vue $t() — the scanner depends on that convention, so a codebase with hardcoded copy will produce poor coverage.nwidart/laravel-modules.Look elsewhere when
--context flag passes project context to the model, but it is not a persistent, versioned glossary — repeated runs will not converge on your preferred terminology.pcntl extension — you lose the fork driver's throughput and fall back to sequential runs.--source option; v5 raised the PHP floor to 8.3). Adopt as a dev-time convenience, never as something production runtime depends on.Adoption checklist before committing
--dry-run first and read translation_extraction_log.json for missed keys.lang/ in code review — machine-generated diffs need a reviewer, or quality silently drifts.For executives — one paragraph
This is a free, MIT-licensed Laravel command that scans our codebase for translatable text, machine-translates it with Google's Gemini AI, and writes standard Laravel language files. It converts "open a new market" from a multi-week, budgeted translation project into a single command we can run in an afternoon and preview without writing anything (--dry-run). It is a developer tool, not a runtime dependency — nothing ships to customers because of it, and removing it costs us nothing but the command itself. The tradeoff we are accepting: translations are unreviewed machine output, so this is the right tool for validating demand and shipping internal or low-stakes surfaces, not for legal, marketing, or regulated copy. Recommended position: adopt it as our zero-cost baseline for locale prototyping, measure real usage per market, and only fund human translation or a paid translation platform where the data supports it.
For engineering — the practical case
lang/*.php and *.json. No runtime coupling, no service provider in the request path, no schema changes. Reversible in one composer remove.str_replace-style failures), Laravel pluralization format retention, locale canonicalization (en-US → en_US), RTL/CJK/Cyrillic script handling, and framework translation bootstrapping.--dry-run that writes nothing. Generated output lands in git and goes through normal code review.--skip-existing for incremental runs, --refresh to re-translate after a terminology decision, configurable --chunk-size and --concurrency, retry/backoff for rate limits, and structured failure output (failed_translation_keys.json) so a partial run is diagnosable rather than silent.pcntl needed for the fork driver (Windows falls back to sync), tokenizer extension for parsing, and a documented gotcha where config/gemini.php must cast request_timeout to int or the command fails at startup. Free-tier Gemini quotas (~15 RPM / 1,000 daily) will throttle a large first run.lang/ output as the durable asset — the tool is disposable.How can I help you explore Laravel packages today?