定制 erag/laravel-lang-sync-inertia 二次开发

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

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

erag/laravel-lang-sync-inertia

Composer 安装命令:

composer require erag/laravel-lang-sync-inertia

包简介

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

README 文档

README

Laravel Lang Sync Inertia

License Latest Stable Version Laravel Compatibility Total Downloads

About Laravel Lang Sync Inertia

Laravel Lang Sync Inertia is a lightweight package for sharing Laravel translation files with Inertia.js applications. It provides a simple way to make backend language files available inside Vue 3, React, and Svelte pages without manually passing translation props in every response.

Features

  • 🔄 Automatic translation sharing through Inertia.js shared props.
  • 📦 Load single or multiple Laravel language files with syncLangFiles().
  • 🧩 Dedicated Vue 3, React, and Svelte helpers from @erag/lang-sync-inertia.
  • 📝 Use clean frontend helpers like __(), trans(), transChoice(), and trans_choice().
  • ✨ Laravel-style placeholder replacement with :name values.
  • 🧱 Legacy {name} placeholder support for existing translation files.
  • 🔢 Pluralization support with Laravel-style exact and interval choices.
  • 🌐 Locale-aware loading from lang/{locale} using Laravel's current app locale.
  • 📤 Export PHP language files to frontend-ready JSON with php artisan erag:generate-lang.
  • ↩️ Direct string fallback when a translation key is not found.
  • 🛠️ Configurable language source and JSON output paths.
  • ✅ TypeScript-ready frontend helper package.

Documentation

Documentation for Laravel Lang Sync Inertia can be found at https://erag.in/laravel-lang-sync-inertia/.

Installation

Install the Laravel package using Composer:

composer require erag/laravel-lang-sync-inertia

Install the frontend helper package using npm:

npm install @erag/lang-sync-inertia

NPM package repository: https://github.com/eramitgupta/lang-sync-inertia

Contributing

Thank you for considering contributing to Laravel Lang Sync Inertia.

Support the Project ⭐

If you find Laravel Lang Sync Inertia useful, please consider giving it a star on GitHub. It helps the project grow and reach more developers!

License

Laravel Lang Sync Inertia is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 24.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 48
  • 点击次数: 25
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 48
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固