backstage/laravel-translations

A Laravel translations package

v0.3.1 2025-09-26 08:29 UTC

README

Laravel Translations

Nice to meet you, we're Vormkracht10

Break Language Barriers, Empower Global Success

license last-commit repo-top-language repo-language-count 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)