php-translation/extractor
PHP Translation Extractor scans PHP and Blade source files for translatable strings, pulling calls such as __(), trans(), and @lang into structured translation files. It helps keep Laravel and Symfony language files in sync with your code and reduces missing or stale translations.
Adopt if:
__(), trans(), @lang, and @choice. The release history explicitly tracks host PHP version parsing, Symfony 8 allowance, and nikic/php-parser v5, so modern syntax should parse cleanly.Look elsewhere if:
i18next-scanner or equivalent for the frontend regardless.For executives: "This is a small, MIT-licensed utility that inventories every translatable string in our PHP/Laravel codebase and keeps translation files in sync automatically. It costs nothing to license, has no vendor lock-in, and it lets us price and sequence international expansion with real string counts instead of estimates — while deferring any paid translation-platform commitment. The trade-off is honest: it is a narrowly adopted open-source tool, so we treat it as an internal, pinned dependency with an owner and a fallback, not as strategic infrastructure. Extraction is the cheap half of localization; the paid half stays a separate, later decision."
For engineering: "It is a CLI on top of nikic/php-parser v5 that walks our PHP/Blade sources, finds __(), trans(), @lang, form labels, and constraint messages, and creates or updates the matching PHP/JSON translation files while preserving existing entries. Integration is a Composer dev dependency plus one CI job; the diff is deterministic and reviewable, so it becomes a PR gate. Supports PHP 8.1–8.3 and recent Symfony. Caveats to plan for: verify JS/TS coverage before relying on it, watch for false negatives on dynamically constructed keys, and wrap it behind a single make/CI target so we can swap the tool without touching the pipeline. Ask: a 2–3 day spike to measure real string coverage and confirm parser behavior on our codebase, and one named owner for upgrades."
How can I help you explore Laravel packages today?