niels-numbers/laravel-localizer
最新稳定版本:v1.2.2
Composer 安装命令:
composer require niels-numbers/laravel-localizer
包简介
Detects the user’s preferred language and redirects to the matching localized URL.
README 文档
README
Successor to
mcamara/laravel-localization. Static routes,route:cacheready.
Locale-aware routing for Laravel: auto-detect, auto-redirect, and resolve route() per language.
Documentation: localizer.adam-nielsen.de
Example
Route::localize(function () { Route::get('/about', AboutController::class)->name('about'); });
Produces:
/aboutfor the default locale (e.g. English), prefix hidden/de/about,/fr/about, ... for every other configured locale
In your application code, keep using route('about'); the package
picks the right variant based on the current locale.
Install
composer require niels-numbers/laravel-localizer
Setup guide · Migrating from mcamara/laravel-localization?
License & credits
MIT licensed. Created by Adam Nielsen, building on prior work by
@mcamara (original
laravel-localization),
@codezero-be (deprecated
laravel-localized-routes, whose static-route ideas inspired this
rewrite) and
@jordyvanderhaegen (current
maintainer of the original, whose
issue #921
motivated this package).
统计信息
- 总下载量: 455
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-29