mariuzzo/laravel-js-localization
Export Laravel translation files to JavaScript. Generate a JS bundle (with Lang.js) via artisan to use familiar Laravel-style trans() and pluralization on the frontend. Supports Laravel 4.2 through 8.x, with options to choose files and output path.
config/app.php locales).en_US vs. en_GB).Adopt if:
Look elsewhere if:
i18next or vue-i18n).resources/lang/).*"This package lets us deliver a globally scalable product without fragmenting our localization efforts. By syncing Laravel’s translation system with the frontend, we:
Example: If we launch in Spain, we’ll reuse our English translations, adapt them for Spanish, and serve localized tooltips/dates dynamically—all while keeping our dev costs low."*
*"This solves a critical pain point in Laravel apps: frontend localization without duplication. Here’s why it’s a no-brainer:
resources/lang/ (Laravel’s native format), so your backend and frontend teams use the same files. No more out-of-sync JSON.Trade-off: Requires discipline to keep translation files in sync, but the payoff for global apps is massive. Let’s prototype it for [high-impact feature X] and measure the dev velocity gain."*
Pro Tip: Demo the package by localizing a single high-visibility UI element (e.g., a dashboard header) in 2 languages. Show how the same translation file powers both the backend (e.g., emails) and frontend.
How can I help you explore Laravel packages today?