- What is themsaid/laravel-langman used for?
- Laravel Langman is a developer-facing Artisan toolkit for managing Laravel translation files. It scans views and controllers for __(), @lang, and trans() calls, compares them against resources/lang files, and reports missing or orphaned keys. It also provides commands to append, find, and show translation entries. It is a development workflow tool, not runtime application code.
- Does laravel-langman support Laravel 8, 9, 10, or 11?
- No, it targets Laravel 5.x-era applications. The illuminate/support constraint and 2017 codebase will not resolve against modern Laravel without modification. For Laravel 8 and newer, treat the repository as a design reference rather than an installable package. You would need to fork or reimplement the useful commands.
- How do I install themsaid/laravel-langman?
- On a legacy Laravel 5.x project, install it as a dev dependency with composer require --dev themsaid/laravel-langman if the version constraints resolve. Do not add it as a production dependency, since it ships no runtime code path. If Composer resolution fails, vendor the source into an internal tools namespace or fork it under your own package name.
- Why does Laravel Langman miss dynamically constructed translation keys?
- Langman uses heuristic source scanning, so keys built at runtime are hard to detect. Examples include __('status.' . $code), keys stored in variables, pluralization cases, and JSON translation files. These can produce missed keys or false positives. Review scanner output before applying changes and handle dynamic keys with a custom convention or command.
- Can I use laravel-langman in CI to fail builds on missing translation keys?
- The original package was built as an interactive console tool, not as a CI gate. A report-only missing-keys command could be adapted to exit non-zero in CI, but that requires a fork or a custom Artisan command. For modern Laravel projects, a small internal command that scans for keys and fails the build is usually cleaner than patching Langman.
- Does laravel-langman work with PHP 8?
- No, the last release is from 2017 and the codebase is PHP 7.0-era. Expect breakage on PHP 8 around reserved words, typing, and string offset behavior. Making it work requires a fork that updates the PHP constraint, replaces deprecated helpers, and adds tests around the scanner.
- Is themsaid/laravel-langman still maintained?
- No, the last release was on 2017-08-06 and there is no active upstream maintenance. There are no framework alignment fixes, security responses, or PHP 8 updates. Treat it as an unmaintained reference implementation rather than a dependency to adopt as-is.
- What are alternatives to laravel-langman for managing Laravel translations?
- For modern Laravel applications, use a maintained translation management package, a translation vendor handoff workflow, or a small internal Artisan command. The core value can be reimplemented with nikic/php-parser to extract keys from Blade and PHP files. If your main pain is CI enforcement, a report-only command that fails the build on missing keys is often enough.
- Does laravel-langman support JSON translation files and Laravel's lang/ directory?
- No, it was built around resources/lang PHP array files and regex assumptions about that layout. Laravel's move to a project-root lang/ directory and JSON translation files are not handled by the original scanner. Supporting JSON files materially changes the build-versus-fork calculation and usually requires custom work.
- Is it safe to let Langman write changes to my language files?
- The package has low runtime security exposure because it makes no network calls and has no authentication surface. The main risk is data loss from file-writing commands that can overwrite or reorder language entries, especially on developer workstations. Run it on a clean branch, review the diff in a pull request, and keep backups before applying bulk changes.