syriable/laravel-localizer
Syriable Localizer is a modern extraction engine for Laravel 13 that scans Blade, PHP, Vue, JS/TS, Livewire and Inertia files to discover and normalize translatable strings, returning typed immutable DTOs via a stable, contracts-driven API.
Strengths:
Fit Risks:
laravel-lang or php-gettext, evaluate redundancy in extraction vs. runtime translation.localizer:extract) or CLI tool for batch processing..localizer.php (e.g., ignore paths, custom regex for extraction).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Extraction accuracy | High | Pilot on a subset of files; compare outputs with manual extraction. |
| Performance | Medium | Benchmark on large codebases (e.g., 10K+ files). |
| Framework drift | Medium | Monitor for breaking changes in Livewire/Inertia/Vue 3+. |
| IDE/tooling gaps | Low | Supplement with VSCode/Laravel IDE Helpers for real-time hints. |
xgettext? Other tools?)gettext, laravel-lang, or custom pipelines).composer require syriable/laravel-localizer.php artisan localizer:extract on a single module (e.g., /resources/views/auth)..json/.php translation files for accuracy..localizer.php to:
{{ $user->name }} vs. {{ __('key') }}).- name: Extract translations
run: php artisan localizer:extract --output=lang/source
- name: Validate new strings
run: git diff --exit-code lang/source || (echo "New strings found!" && exit 1)
{{ __('key') }} consistently (or configure to extract dynamic strings).i18n.t() and template literals.console.log or API responses.--format flag if needed..localizer.php for false positives/negatives..localizer.php rules in the team’s style guide..json/.php files.laravel-lang’s merge command).{{ __('key') }} vs. dynamic)..localizer.php.| Failure Mode | Impact | Detection/Recovery |
|---|---|---|
| Extraction misses strings | Untranslated UI elements. | Manual review; add test cases for edge patterns. |
| False positives | Noise in translation files. | Configure .localizer.php; train devs. |
| CI flakiness | False "new strings" alerts. | Whitelist known dynamic strings in config. |
| Tooling gaps | No IDE support. | Supplement with custom snippets/extensions. |
| Runtime errors | Broken translations at runtime. | Validate output matches existing keys. |
How can I help you explore Laravel packages today?