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
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(),__(),@langin 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
- Installation & Setup
- Configuration
- Basic Usage
- Model Attributes
- Translation Providers
- Commands Reference
- Advanced Usage
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
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-20