queiroz / tld-lang
TldLang multi domain site language for Laravel 4
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/queiroz/tld-lang
Requires
- php: >=5.3.0
- illuminate/support: 4.1.x
This package is not auto-updated.
Last update: 2020-08-16 19:28:02 UTC
README
Laravel 4 - auto select language based on domain .tld
Installation
Add TldLang to your composer.json file:
"require": {
"queiroz/tld-lang": "dev-master"
}
Use composer to install this package.
$ composer update
Configuration
Registering the Package
register this service provider at the bottom of the $providers array: app.php
'Queiroz\TldLang\TldLangServiceProvider'
Usage
Basic usage
Supose you have domain.com (English), domain2.es (Spanish), domain3.fr (French) you can simply change the system language based on this .tlds
TldLang::set(array(
'.com' => 'en',
'.es' => 'es',
'.fr' => 'fr'
));
and finally initialize
TldLang::init();