定制 backstage/laravel-translations 二次开发

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

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

backstage/laravel-translations

最新稳定版本:v2.0.0-beta11

Composer 安装命令:

composer require backstage/laravel-translations

包简介

A Laravel translations package

README 文档

README

Laravel Translations

Nice to meet you, we're Vormkracht10

Break Language Barriers, Empower Global Success

license last-commit Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Quick Start

Laravel Translations makes multilingual Laravel applications simple. Scan, translate, and manage your translations automatically.

1. Install

composer require backstage/laravel-translations

php artisan vendor:publish --provider="Backstage\Translations\Laravel\TranslationServiceProvider"

php artisan migrate

2. Add Languages

php artisan translations:languages:add en English

php artisan translations:languages:add es Spanish

php artisan translations:languages:add fr French

3. Scan & Translate

# Scan your app for translation strings
php artisan translations:scan

# Translate them automatically
php artisan translations:translate

That's it! Your translations are now managed automatically.

Features

  • 🌐 Multiple Providers: Google Translate, DeepL, AI (OpenAI, etc.)
  • 🔄 Auto-Scanning: Finds trans(), __(), @lang in your code
  • 🏷️ Model Attributes: Translate Eloquent model attributes automatically
  • 📊 Language Management: Add, remove, and manage languages easily
  • Performance: Optional caching and queued operations
  • 🎯 Laravel Integration: Works seamlessly with Laravel's translation system

Model Translation

Translate Eloquent model attributes automatically. See the Model Attributes guide for detailed setup and usage.

Commands

# Add languages
php artisan translations:languages:add {locale} {label}

# Scan for translations
php artisan translations:scan

# Translate strings
php artisan translations:translate

php artisan translations:translate --code=es

php artisan translations:translate --update

# Sync translations
php artisan translations:sync

Translation Providers

Supports Google Translate, DeepL, and AI providers. See the Translation Providers guide for configuration details.

Documentation

📚 Complete Documentation - Detailed guides and API reference

Requirements

  • PHP 8.2+
  • Laravel 10.x, 11.x, or 12.x

License

MIT License. See LICENSE for details.

Contributing

Made with ❤️ by [Vormkracht10](https://vormkracht10.nl)

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-20