PHPackages                             litepie/trans - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. litepie/trans

ActiveLibrary[Localization &amp; i18n](/categories/localization)

litepie/trans
=============

A modern, production-ready, and well-documented PHP translation package with language negotiation and Laravel integration.

v1.0.2(10mo ago)081MITPHPPHP &gt;=8.1

Since Aug 22Pushed 10mo agoCompare

[ Source](https://github.com/Litepie/Trans)[ Packagist](https://packagist.org/packages/litepie/trans)[ Docs](https://github.com/litepie/trans)[ RSS](/packages/litepie-trans/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (10)Versions (4)Used By (1)

Litepie Trans - Enhanced Laravel Translation Package
====================================================

[](#litepie-trans---enhanced-laravel-translation-package)

[![Latest Version](https://camo.githubusercontent.com/3fa535157d63877d14138eb3c13f9da10ce1fc0902e781b7bef3265d268b710a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c6974657069652f7472616e733f7374796c653d666c61742d737175617265)](https://github.com/litepie/trans/releases)[![License](https://camo.githubusercontent.com/e2acf426e19a628a61831bd831854e2395f96409a7a2c9e4a82fefb8260727d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6974657069652f7472616e733f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/987e0a7dbbde7d7b5eb18ca7e56f2e903610950741c2ae35ef9125bb51467b19/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242463f7374796c653d666c61742d737175617265)](https://php.net)[![Laravel Version](https://camo.githubusercontent.com/113a060e9d7c13be0f3acc50e54d8aa543bd6e3c52f9b39a179ea199c519639a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d253345253344392e302d4646324432303f7374796c653d666c61742d737175617265)](https://laravel.com)

A modern, production-ready, and well-documented PHP translation package with advanced language negotiation, URL localization, route translation, and comprehensive Laravel integration. **Now fully compatible with Laravel 12!**

✨ Features
----------

[](#-features)

- 🌍 **Automatic Language Detection** - Intelligent locale detection from Accept-Language headers
- 🔗 **URL-based Locale Switching** - Clean, SEO-friendly localized URLs
- 🛣️ **Route Translation** - Translate route patterns and parameters
- ⚡ **Performance Optimized** - Built-in caching and optimization for Laravel 12
- 🔧 **Middleware Integration** - Seamless Laravel 12 middleware support
- 🎯 **Type Safe** - Full PHP 8.1+ type declarations and strict types
- 📱 **Multi-directional Support** - LTR and RTL language support
- 🍪 **Session &amp; Cookie Support** - Remember user language preferences
- 🧪 **Comprehensive Testing** - Full test suite included
- 📚 **Rich Documentation** - Extensive documentation and examples
- 🚀 **Laravel 12 Ready** - Fully compatible with the latest Laravel version

🚀 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require litepie/trans
```

### Laravel Auto-Discovery

[](#laravel-auto-discovery)

The package will automatically register its service provider and aliases.

### Manual Registration (if needed)

[](#manual-registration-if-needed)

Add the service provider to your `config/app.php`:

```
'providers' => [
    // Other providers...
    Litepie\Trans\TransServiceProvider::class,
],
```

### Publish Configuration

[](#publish-configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Litepie\Trans\TransServiceProvider" --tag="trans-config"
```

⚙️ Configuration
----------------

[](#️-configuration)

The configuration file `config/trans.php` provides extensive customization options:

```
