2017 © Pedro Peláez
 

library laralang

image

premise/laralang

  • Sunday, November 27, 2016
  • by RichJones22
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 23 Versions
  • 0 % Grown

The README.md

Laralang

StyleCI Scrutinizer GitHub license, (*1)

, (*2)

Getting Started

Step 1. Install it with composer

Running the command below:, (*3)

composer require Premise/laralang

Step 2. Register service provider & aliases

Include the line below to config/app.php inside array 'providers' => [ :, (*4)

Premise\Laralang\LaralangServiceProvider::class,

Include the line below to config/app.php inside array 'aliases' => [ :, (*5)

'Laralang'   => Premise\Laralang\Facades\Laralang::class,

Step 3. Publish vendor

It will publish assets and config file., (*6)

Running the command below:, (*7)

php artisan vendor:publish

Step 4. Migrate

Running the command below:, (*8)

php artisan migrate

Step 5. Configure default values

STRONGLY IMPORTANT: Change the password of config (Default password: laralangAdmin ), (*9)

Apart from the password, the rest of default values can be modified also on config/laralang.php. Furthermore you can modify it in a specific translation with the functions below., (*10)

Using laralang

Functions

setFrom(), (*11)

It sets the language of the string to translate in a specific translation., (*12)

Default: en, (*13)

SetTo(), (*14)

It sets the language that you'll output in a specific translation., (*15)

Default: app_locale, (*16)

SetTranslator(), (*17)

This option let you to change the default translator in a specific translation., (*18)

Default: mymemory, (*19)

Currently there are two available translators: apertium, mymemory. But we strongly recommend to use mymemory., (*20)

setDebug(), (*21)

Debug option let you to know the reason of an unexpected result with colorful messages in a specific translation., (*22)

Default: false, (*23)


Examples of use

Then few examples of tranlsation:, (*24)

{!! Laralang::trans('Hello world!') !!}
<br>
{!! Laralang::trans('Hello world!')->setDebug(true) !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('es') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('ca') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('ca')->setDebug(true) !!}
<br>
{!! Laralang::trans('Hallo welt!')->setFrom('de')->setTo('fr') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('pt') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('de') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('ml') !!}
<br>
{!! Laralang::trans('Hello world!')->setTo('zh') !!}

Then the result:, (*25)

Result of example, (*26)

Admin panel

Furthermore now you can control which translations are saved on your DB and then you can manage it (edit and delete)., (*27)

First you should be logged into loaralang.

Route prefix can be changed on your config file, but by default it's laralang, (*28)

  • How to acces to panel?

You should visit next url:, (*29)

http://host.domain/laralang/login, (*30)

or in localhost you should visit, (*31)

http://localhost/project-path/public/laralang/login, (*32)

Then you should see the laralang login page (photo below), (*33)

Laralang login page, (*34)

Now you must enter the password you set on Step 5 and then click login to manage your translations!, (*35)

View of translations, (*36)

Editing translation #3, (*37)

The Versions

27/11 2016

dev-master

9999999-dev

  Sources   Download

26/11 2016

dev-analysis-qyk6MG

dev-analysis-qyk6MG

This package let you translate strings from any language to another in laravel 5.X

  Sources   Download

MIT

21/11 2016

3.0

3.0.0.0

This package let you translate strings from any language to another in laravel 5.X

  Sources   Download

MIT

19/11 2016

dev-analysis-z9nWll

dev-analysis-z9nWll

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

18/11 2016

dev-analysis-zYoROA

dev-analysis-zYoROA

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

04/11 2016

dev-analysis-863ak4

dev-analysis-863ak4

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

03/11 2016

2.3

2.3.0.0

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

03/11 2016

dev-analysis-qoWVkB

dev-analysis-qoWVkB

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

03/11 2016

dev-analysis-zeYw7r

dev-analysis-zeYw7r

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

01/11 2016

2.2.1

2.2.1.0

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

01/11 2016

2.2

2.2.0.0

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

01/11 2016

dev-analysis-zGJL1o

dev-analysis-zGJL1o

This package let you translate strings from any language to another in laravel 5.x

  Sources   Download

MIT

31/10 2016

2.1.1

2.1.1.0

Translate strings from any lenguage to another in laravel 5.

  Sources   Download

MIT

30/10 2016

dev-analysis-XZoZBa

dev-analysis-XZoZBa

Translate strings from any lenguage to another in laravel 5.

  Sources   Download

MIT

30/10 2016

2.1

2.1.0.0

Translate strings from any lenguage to another in laravel 5.

  Sources   Download

MIT

30/10 2016

2.0

2.0.0.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

19/10 2016

1.2.2

1.2.2.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

03/10 2016

1.2.1

1.2.1.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

28/09 2016

1.2

1.2.0.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

28/09 2016

1.1

1.1.0.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

28/09 2016

1.0.2

1.0.2.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

28/09 2016

1.0.1

1.0.1.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT

28/09 2016

1.0

1.0.0.0

This package includes a list of translations frequently used in web pages.

  Sources   Download

MIT