2017 © Pedro Peláez
 

library laravel-translator

Flexible Laravel translator

image

hokan22/laravel-translator

Flexible Laravel translator

  • Thursday, July 19, 2018
  • by Hokan22
  • Repository
  • 3 Watchers
  • 1 Stars
  • 97 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 27 Versions
  • 98 % Grown

The README.md

Laravel Translator

Latest Version on Packagist ![Software License][ico-license] Scrutinizer Code Quality, (*1)

Install

Via Composer, (*2)

``` bash $ composer require hokan22/laravel-translator, (*3)


## Setup Add the service provider to the providers array in `config/app.php`. ``` php 'providers' => [ Hokan22\LaravelTranslator\Provider\TranslatorProvider::class, Hokan22\LaravelTranslator\Provider\TranslatorBladeProvider::class, ];

Additionally you might want to add an alias to the aliases array within the config/app.php file., (*4)

``` php 'aliases' => [ 'Translator' => Hokan22\LaravelTranslator\TranslatorFacade::class, ];, (*5)


## Middleware You may want to use the middleware in order to control the global language setup inside `app/Http/Kernel.php`. ``` php protected $routeMiddleware = [ 'translator' => \Hokan22\LaravelTranslator\Middleware\TranslatorMiddleware::class, ];

Publishing

You can publish the configuration with:, (*6)

``` php php artisan vendor:publish --provider="Hokan22\LaravelTranslator\Provider\TranslatorProvider", (*7)


## Usage This Package provides an easily extendable translation function with parameters for laravel. After you registered the TranslatorBladeServiceProvider you can use the ```@t()``` or ```@translate()``` blade directives to translate your website into different languages. You can define a locale through the translator middleware or define a locale for each translation individually.

@t('Hello World!') @t('Hello {name}!', ['name' => World], 'de_DE') @t('Hello World', [], 'fr_FR'), (*8)


### Parameters Parameters are simply surrounded by `{}` and their replacement provided as an array as the second parameter of the blade translate directive.

@t('Visit the site {link}.', ['link' => 'Example.com']), (*9)


### Custom Locales If you use a different locale schema, just change the ```available_locales``` array in the config file. ### Custom Translation Handler To use your custom Translation Handler make sure it implements the Interface: ``` Hokan22\LaravelTranslator\Handler\HandlerInterface.php ``` Now just change the 'handler' config parameter in ``` config\translator.php ``` to your custom Handler class. ``` php 'handler' => Hokan22\LaravelTranslator\Handler\DatabaseHandler::class,

Custom Translation Routes

By default the Translator admin Interface is reachable under /translator/admin. To override the default routes change the custom_routes parameter in the config to true and define the routes as you need them. NOTE: In Order to use the "Live Mode" make sure you give the route to TranslatorAdminController@edit the name: 'translator.admin.edit'., (*10)

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

19/07 2018

dev-master

9999999-dev https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

19/07 2018

dev-develop

dev-develop https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

19/07 2018

v1.3.3

1.3.3.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

03/07 2018

v1.3.2

1.3.2.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

15/06 2018

v1.3.1

1.3.1.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

27/04 2018

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

27/04 2018

v1.3.0

1.3.0.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

27/04 2018

dev-feature/clean_command

dev-feature/clean_command https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

26/04 2018

v1.2.0

1.2.0.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

26/04 2018

dev-release/v1.2.0

dev-release/v1.2.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

13/04 2018

v1.1.2

1.1.2.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

12/04 2018

1.1.1

1.1.1.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

14/03 2018

1.1.0

1.1.0.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

23/02 2018

dev-feature/live_mode

dev-feature/live_mode https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

29/01 2018

1.0.12

1.0.12.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

29/01 2018

1.0.11

1.0.11.0 https://github.com/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

10/01 2018

1.0.10

1.0.10.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

09/01 2018

1.0.9

1.0.9.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

09/01 2018

1.0.8

1.0.8.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.7

1.0.7.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.6

1.0.6.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.5

1.0.5.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.4

1.0.4.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.3

1.0.3.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.2

1.0.2.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.1

1.0.1.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22

08/01 2018

1.0.0

1.0.0.0 https://bitbucket.org/hokan22/laravel-translator

Flexible Laravel translator

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alexander Viertel

laravel language translator multilang hokan22