Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Localizer

Laravel Localizer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

A modern, focused localization extraction engine for Laravel 13. Discovers, extracts, and normalizes translatable strings from Blade, PHP, Vue, JavaScript, TypeScript, Livewire, and Inertia source files.

Frequently asked questions about Laravel Localizer
How does Syriable Localizer compare to Laravel’s built-in `__()` function for extraction?
Syriable Localizer goes beyond `__()` by scanning *all* source files (Blade, Vue, JS/TS, Livewire, Inertia) for translatable strings, even dynamic or untranslated ones. It normalizes formats (e.g., interpolation, pluralization) and outputs structured DTOs for static analysis, while Laravel’s `__()` only handles runtime translation keys.
Can this package extract strings from JavaScript/TypeScript files in a Laravel + Inertia/Vue app?
Yes, it supports JS/TS files by default, including Vue SFCs, Inertia components, and raw scripts. For edge cases like dynamic keys or JSX, you’ll need to configure custom regex patterns in `.localizer.php` to avoid false positives/negatives.
Will this break existing translation workflows (e.g., PO/MO files or laravel-lang)?
No, it’s extraction-only and outputs PO/MO-compatible files. It integrates with existing pipelines (e.g., Crowdin, Lokalise) and won’t modify runtime translation logic. Test outputs against your current `.json`/`.php` files to validate compatibility.
How do I run this in CI to block PRs with untranslated strings?
Add `php artisan localizer:extract --output=lang/source` to your CI, then use a script to compare new strings against your translation files. Example: `git diff --exit-code lang/source || exit 1`. Configure `.localizer.php` to ignore test/vendor paths.
Does this work with Livewire components that mix PHP and JavaScript?
Yes, it scans Livewire files for both Blade and JS/TS strings. For complex cases (e.g., Alpine.js + Livewire), ensure your `.localizer.php` includes the correct file patterns. Test with a sample component to validate coverage.
What Laravel versions and PHP requirements does this support?
It’s built for Laravel 13+ and requires PHP 8.2+. It avoids Symfony/Doctrine dependencies, relying only on Laravel’s core. For older Laravel versions, check the GitHub issues for backport discussions or fork the package.
How do I handle false positives (e.g., extracting non-translatable strings like API keys)?
Use `.localizer.php` to define ignore patterns (e.g., regex for UUIDs, config keys). For dynamic strings (e.g., `{{ $user->name }}`), configure custom extraction rules or use the `--strict` flag to exclude them.
Can this replace `php-gettext` or `laravel-lang` for runtime translations?
No, this is *only* for extraction. Use it alongside `laravel-lang` or `gettext` for runtime translation. It outputs PO/MO files compatible with those packages, so you can pipe its results into your existing workflow.
How do I configure it to ignore specific directories or file types?
Edit `.localizer.php` to add `ignore_paths` (e.g., `['vendor/*', 'tests/*']`) or `ignore_patterns` (e.g., regex for `.min.js`). Example: `'ignore_paths' => [storage_path('logs/*')]`. Run `php artisan localizer:extract --dry-run` to test.
Are there performance concerns for large codebases (e.g., 10K+ files)?
Benchmark with your codebase, but it’s optimized for speed. For CI, cache results or run incrementally (e.g., `localizer:extract --path=resources/views`). If slow, exclude non-critical paths (e.g., `node_modules`) in `.localizer.php`.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel