2017 © Pedro PelĂĄez
 

library laravel-translation

Library to manage Laravel translations

image

exolnet/laravel-translation

Library to manage Laravel translations

  • Tuesday, July 17, 2018
  • by xel1045
  • Repository
  • 4 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 25 % Grown

The README.md

Laravel Translation

Latest Stable Version Software License Build Status Total Downloads, (*1)

Library to manage Laravel translations, (*2)

Installation

Require this package with composer:, (*3)

composer require exolnet/laravel-translation

To make sure the routing system is using the one supporting the translation you must edit your bootstrap/app.php to change the Application class import, (*4)

sed -i '' 's/Illuminate\\Foundation\\Application/Exolnet\\Translation\\Application/g' bootstrap/app.php

Now you're ready to start using the translation in your application., (*5)

Config

Config Files

In order to edit the default configuration (where for e.g. you can find available_locales) for this package you may execute:, (*6)

php artisan vendor:publish --provider="Exolnet\Translation\TranslationServiceProvider"

After that, config/translation.php will be created. Inside this file you will find all the fields that can be edited in this package., (*7)

Usage

Exolnet Translation uses the URL given for the request. In order to achieve this purpose, a route group should be added into the routes/web.php file. It will filter all pages that must be localized., (*8)

// routes/web.php

Route::groupLocales(function () {
    Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
});

Once this route group is added to the routes file, a user can access all locales added into available_locales. For example, a user can now access two different locales, using the following addresses:, (*9)

http://url-to-laravel/en
http://url-to-laravel/fr

If you when to remove the locale prefix on the base locale you need to set the $avoidPrefixOnBaseLocale to true when defining the groupLocale, (*10)

// routes/web.php

Route::groupLocales(function () {
    Route::get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
})->hiddenBaseLocale();

Testing

To run the phpUnit tests, please use:, (*11)

composer test

Contributing

Please see CONTRIBUTING and CODE OF CONDUCT for details., (*12)

Security

If you discover any security related issues, please email security@exolnet.com instead of using the issue tracker., (*13)

Credits

License

Copyright © eXolnet. All rights reserved., (*14)

This code is licensed under the MIT license. Please see the license file for more information., (*15)

The Versions

07/03 2016

5.1.x-dev

5.1.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

07/03 2016

5.3.x-dev

5.3.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

07/03 2016

5.4.x-dev

5.4.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

07/03 2016

5.2.x-dev

5.2.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

07/03 2016

5.5.x-dev

5.5.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

03/02 2016

4.2.x-dev

4.2.9999999.9999999-dev

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

03/02 2016

v2.0.0

2.0.0.0

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

28/10 2015

v1.1.0

1.1.0.0

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet

28/10 2015

v1.2.0

1.2.0.0

The eXolnet Laravel Translation package.

  Sources   Download

MIT

The Requires

 

laravel translation exolnet