jobmetric / laravel-translation
This is a package for translating the contents of different Laravel projects.
Installs: 49
Dependents: 4
Suggesters: 0
Security: 0
Stars: 10
Watchers: 2
Forks: 2
Open Issues: 1
pkg:composer/jobmetric/laravel-translation
Requires
- php: >=8.0.1
- ext-json: *
- jobmetric/laravel-custom-field: ^2.1
- jobmetric/laravel-event-system: ^2.7
- jobmetric/laravel-language: ^2.4
- jobmetric/laravel-metadata: ^3.6
- jobmetric/laravel-package-core: ^1.34
- laravel/framework: >=9.19
This package is auto-updated.
Last update: 2025-12-30 18:02:52 UTC
README
Laravel Translation
Build Multilingual Applications. Effortlessly.
Laravel Translation simplifies the management of multilingual content within Laravel applications. Stop managing translations manually and start building truly multilingual applications with ease. It offers dynamic translation storage, retrieval, and updates, seamlessly integrating with your models through the HasTranslation trait. This is where powerful multilingual support meets developer-friendly simplicity—giving you complete control over translation management without the complexity.
Why Laravel Translation?
Seamless Model Integration
Integrate translations directly with your Eloquent models through a simple trait. No complex setup, no additional services—just add the trait and define which fields should be translatable. Your models become multilingual instantly.
Flexible Field Control
You have complete control over which fields can be translated. Whitelist specific fields or allow all fields with a simple configuration. This flexibility ensures you only translate what needs to be translated, keeping your database clean and efficient.
Version History Built-In
Track every change to your translations with optional versioning. See what changed, when it changed, and restore previous versions if needed. Perfect for content management systems where translation history matters.
Powerful Query Capabilities
Search and filter your models based on translated content. Find products by their translated names, filter posts by translated titles, and build multilingual search functionality with ease.
What is Translation Management?
Translation management is the process of storing and retrieving content in multiple languages. In a traditional Laravel application, you might store translations in language files or use separate columns for each language. Laravel Translation takes a different approach:
- Database-Driven: Translations are stored in the database, making them dynamic and manageable through your application
- Per-Field Translations: Each field can have different translations for different locales
- Version Control: Track changes to translations over time
- Query Support: Search and filter by translated content directly in your queries
Consider a blog post that needs to be available in multiple languages. With Laravel Translation, you can store the title, summary, and body in different locales, retrieve the appropriate translation based on the user's locale, track version history if content changes over time, and search for posts by their translated titles or content. The power of translation management lies not only in storing multiple language versions but also in making them easily accessible, searchable, and manageable throughout your application.
What Awaits You?
By adopting Laravel Translation, you will:
- Build truly multilingual applications - Support as many languages as you need
- Simplify translation management - No more complex translation logic in your code
- Improve content management - Version history and easy updates
- Enhance user experience - Deliver content in users' preferred languages
- Scale effortlessly - Handle translations for thousands of models and fields
- Maintain clean code - Simple, intuitive API that follows Laravel conventions
Quick Start
Install Laravel Translation via Composer:
composer require jobmetric/laravel-translation
Documentation
Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Translation:
The documentation includes:
- Getting Started - Quick introduction and installation guide
- HasTranslation - Integrate translations into your models
- Requests - Complete API reference for TranslationArrayRequest, MultiTranslationArrayRequest, TranslationTypeObjectRequest, and MultiTranslationTypeObjectRequest
- Resources - TranslationResource and TranslationCollectionResource for API responses
- Validation Rules - TranslationFieldExistRule for ensuring translation uniqueness
- Events - Hook into translation lifecycle
- Real-World Examples - See how it works in practice
Contributing
Thank you for participating in laravel-translation. A contribution guide can be found here.
License
The laravel-translation is open-sourced software licensed under the MIT license. See License File for more information.