jiordiviera/inertia-localize
Larablocks Analysis
jiordiviera/inertia-localize works with Laravel 11, 12 and 13 (latest release v0.2.0, Oct 27, 2026).
Recommendation checks
Use with careUse with care: meets 2 of 5 checks.
- Works with Laravel 13, the current version
- Released in the last 12 months (Oct 27, 2026)
- First released under 90 days ago
- 136 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Too new to judge- Last stable release: Oct 27, 2026.
- 2 releases in the last 12 months.
- First released: Sep 24, 2026.
- Monthly downloads: 136.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require jiordiviera/inertia-localize |
|
| Latest Version: | v0.2.0 |
| PHP: | >=8.2 |
| Laravel: | 11 · 12 · 13 |
| License: | MIT |
| Last Updated: | Oct 27, 2026 |
| Links: | GitHub · Packagist |
jiordiviera/inertia-localize
Laravel package for Inertia Localize. Laravel remains the source of truth for locale selection, fallback behavior, and translation files. This package does not depend on a frontend framework.
Package foundation
The service provider is registered through Laravel package discovery. It merges the package defaults and publishes the configuration file:
php artisan vendor:publish --tag=inertia-localize-config
The configuration defines default, fallback, supported locales, session_key, translation groups, and an optional user_column.
Session locale
Register the locale switch endpoint in routes/web.php. Put SetLocale on locale-aware routes; routes in web.php already start the session before route middleware runs.
use Illuminate\Support\Facades\Route;
use InertiaLocalize\Http\Controllers\LocaleController;
use InertiaLocalize\Http\Middleware\SetLocale;
Route::post('/locale', LocaleController::class)->name('locale.switch');
Route::middleware(SetLocale::class)->group(function () {
Route::get('/', HomeController::class);
});
Post the selected locale as locale to locale.switch. Supported values are stored under the configured session_key; unsupported values receive HTTP 422. On each request, the middleware sets Laravel's application locale from the session and falls back to the configured default when the session value is missing or unsupported. This session-first approach does not add locale URL prefixes or persist a user preference.
Inertia shared props
The package automatically shares an i18n prop on Inertia responses. It contains locale, fallback, locales (code and display name), and messages. Translation groups in inertia-localize.groups are loaded for the active locale and flattened to dot keys prefixed by their group, such as ui.actions.save. The prop is available in the initial server-rendered page without a client fetch and is included in partial reloads.
Tests
composer install --working-dir=packages/laravel
composer test --working-dir=packages/laravel
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.2.0 | >=8.2 | ^11.0| | MIT | |
| v0.1.0 | >=8.2 | ^11.0| | MIT |