定制 linguijs/lingui-laravel 二次开发

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

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

linguijs/lingui-laravel

Composer 安装命令:

composer require linguijs/lingui-laravel

包简介

Artisan command to generate localized JSON files with all your translations.

README 文档

README

Artisan command to generate localized JSON files with all your translations.

Installation

To get started, install Lingui via the Composer package manager:

composer require linguijs/lingui

Next, install the Lingui Vite plugin to ensure that your translations are generated during Vite's build step and also whenever your files change while running the Vite's dev server.

First, install the plugin via your package manager:

npm i -D @linguijs/vite-plugin

Then, update your application's vite.config.js file to watch for changes to your application's lang files:

import { lingui } from "@linguijs/vite-plugin";

export default defineConfig({
  plugins: [
    lingui(),
    // ...
  ],
});

You can read about all of the plugin's configuration options in the documentation.

Generating Translation Files

The ``lingui:make-json` command can be used to generate JSON files containing all your translations grouped by locale:

php artisan lingui:make-json

The --locale option may be used to generate translation for specific locale only:

php artisan lingui:make-json --locale=pt --locale=en

You can safely .gitignore the public/lang directory as he's completely re-generated on every build.

Frontend Usage

Please visit the Lingui repo.

Requirements

  • PHP 8.2+

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-25