Download the PHP package litepie/trans without Composer

On this page you can find all versions of the php package litepie/trans. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package trans

Litepie Trans - Enhanced Laravel Translation Package

Latest Version PHP Version Laravel Version

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

๐Ÿš€ Installation

Install the package via Composer:

Laravel Auto-Discovery

The package will automatically register its service provider and aliases.

Manual Registration (if needed)

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

Publish Configuration

Publish the configuration file:

โš™๏ธ Configuration

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

๐ŸŽฏ Basic Usage

Setting Up Middleware

Add the localization middleware to your routes:

Using the Trans Service

Language Switcher in Blade Templates

Create a language switcher component:

๐ŸŒ Advanced Features

Route Translation

Define translated routes in your language files:

Register translated routes:

Custom Language Negotiation

Locale Detection Priority

The package detects locale in this order:

  1. URL segment - /es/page (highest priority)
  2. Session - Stored user preference
  3. Cookie - Persistent preference
  4. Accept-Language header - Browser preference
  5. Default locale - Fallback (lowest priority)

๐Ÿ”ง Middleware Options

LocalizationMiddleware

Automatically handles locale detection and URL redirection:

Custom Middleware Usage

๐Ÿ“Š API Reference

Trans Class Methods

Locale Management

Locale Information

URL Generation

Utility Methods

LanguageNegotiator Class

๐Ÿงช Testing

Run the test suite:

Example Test

๐Ÿ”’ Security Considerations

๐Ÿš€ Performance Tips

  1. Enable Route Caching:

  2. Use Laravel's Route Caching:

  3. Optimize Config Loading:

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Development Setup

๐Ÿ“ Changelog

Please see CHANGELOG.md for recent changes.

๐Ÿ›ก๏ธ Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.

๐Ÿ™ Credits

๐Ÿ”— Links


Made with โค๏ธ by the Lavalite Team


All versions of trans with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
illuminate/config Version ^9.0|^10.0|^11.0|^12.0
illuminate/translation Version ^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package litepie/trans contains the following files

Loading the files please wait ....