定制 peppe/laravel-route-translator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-03