peppe/laravel-route-translator
最新稳定版本:v1.1.0
Composer 安装命令:
composer require peppe/laravel-route-translator
包简介
A package to translate Laravel routes
关键字:
README 文档
README
A simple Laravel package to translate route URLs using the project's own language files.
Overview
This package allows you to translate route paths based on language files located in your Laravel application's resources/lang/{locale}/routes.php. It does not include any translations itself, so you can fully customize your route translations within your project.
Features
- Translate route URLs dynamically according to the current locale.
- Compatible with Laravel 10, 11, and 12.
- Lightweight and minimal — no bundled translations or views.
- Easily extendable.
Installation
Require the package via Composer:
composer require peppe/laravel-route-translator
Usage
Add your route translation in a bash route.php in your bash lang/{{locale}} . Later you only have to use the trans macro on your route file like this:
Route::get(Route::trans('about'), function () { return __('About Us page'); })->name('about'); Route::get(Route::trans('contact'), function () { return __('Contact page'); })->name('contact');
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-03