定制 zdearo/laravel-auto-translate 二次开发

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

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

zdearo/laravel-auto-translate

最新稳定版本:v1.0.1

Composer 安装命令:

composer require zdearo/laravel-auto-translate

包简介

A Laravel package for auto translate strings.

README 文档

README

A Laravel package for extracting and managing translation strings in your Laravel applications. This package helps you identify untranslated strings in your codebase and manage translations for multiple languages.

Installation

You can install the package via composer in your Laravel project:

composer require zdearo/laravel-auto-translate

You can publish the config file with:

php artisan vendor:publish --tag="laravel-auto-translate-config"

Usage

Extract Translations

This command scans your Laravel application for translation strings and extracts them to a JSON file:

php artisan translations:extract {locale}

Replace {locale} with your desired language code (e.g., en, pt_BR, es_ES).

The command will:

  1. Scan your application for translation strings
  2. Create a new_strings_{locale}.json file with the found strings
  3. Optionally merge the new strings into your existing translation file

Merge Translations

This command merges translated strings from new_strings_{locale}.json to your main translation file:

php artisan translations:merge {locale}

The command offers three merge options:

  1. Only merge strings that have translations
  2. Merge all strings (including empty translations)
  3. Interactive mode: review each untranslated string

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

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