ademozmermer / transbrowser
Change language by browser for Laravel
1.0.0
2020-02-07 15:40 UTC
Requires
- php: >=7.1
- illuminate/support: 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0
- illuminate/translation: 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0
- illuminate/validation: 5.0.*|5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*|^6.0
This package is auto-updated.
Last update: 2025-03-20 21:17:19 UTC
README
About
The language of your Laravel Project will change according to your browser
Installation
Use the package manager composer to install transbrowser.
composer require ademozmermer/transbrowser
Configuration
You can pull a configuration file into your application by running one of the following artisan command.
php artisan vendor:publish --provider="AdemOzmermer\TransBrowser\TransBrowserServiceProvider"
The language that will be used by default when the browser language cannot be found in the languages you want to use.
// transbrowser.php 'default_lang' => 'en',
The codes of the languages you want to use
// transbrowser.php 'all_langs' => [ 'en', 'tr', 'fr', 'gr', ],
Usage
if you want to use it as middleware
Route::middleware('transbrowser')->group(function() { // })
If you want it to be valid everywhere
// Kernel.php protected $middleware = [ ... \AdemOzmermer\TransBrowser\Middleware\TransBrowserMiddleware::class ];
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.