2017 © Pedro Peláez
 

library language

Multi language for Laravel 5.3+

image

aharen/language

Multi language for Laravel 5.3+

  • Wednesday, October 18, 2017
  • by aharen
  • Repository
  • 1 Watchers
  • 1 Stars
  • 180 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 3 % Grown

The README.md

Language

Multi language for Laravel 5.3+, (*1)


Installations

composer require aharen/language, (*2)

Configuration

Add the service provider to providers array in config/app.php, (*3)

aharen\Language\LanguageServiceProvider::class,, (*4)

Add the facade to aliases array in config/app.php, (*5)

'Language' => 'aharen\Language\Facades\Language::class',, (*6)

Run vendor:publish artisan command to publish the database migration file and the default seeder, (*7)

php artisan vendor:publish, (*8)

Now add the DefaultLanguageSeeder to database/DatabaseSeeder.php, (*9)

$this->call(DefaultLanguageSeeder::class);, (*10)

You might need to run composer dumpautoload for the seeder to start working, (*11)

Optional The provided seeder will create English as the default language but you can change the seeder to any language you like., (*12)

In addition you will have to update locale and fallback_locale in config/app.php to your desired default language, since the package uses these to maintain set locale and default locale., (*13)

This will enable the use of Laravels default localization methods and directives such as 'echo trans('messages.welcome');and@lang('messages.welcome'). You can store your translations in the defaultresources/lang` directory., (*14)

Setup

You should add a route prefix to your routes in one of the following ways:, (*15)

  1. In your routes file to the route group, (*16)

    Route::group(['prefix' => \App::getLocale()], function () {
      // your routes here
    });
  2. Or you can modify mapWebRoutes() method in App\RouteServiceProvider as follows:, (*17)

    Route::group([
        'middleware' => 'web',
        'namespace'  => $this->namespace,
        'prefix'     => \App::getLocale(),
    ], function ($router) {
        require base_path('routes/web.php');
    }); 

The Versions

18/10 2017

dev-master

9999999-dev

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

18/10 2017

v1.0.6

1.0.6.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

19/09 2017

v1.0.5

1.0.5.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

19/09 2017

v1.0.4

1.0.4.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

19/09 2017

v1.0.3

1.0.3.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

20/02 2017

v1.0.2

1.0.2.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual

21/09 2016

v1.0.1

1.0.1.0

Multi language for Laravel 5.3+

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel language translate multi-lingual